Quantcast
Channel: Configuration - Home Assistant Community
Viewing all 108763 articles
Browse latest View live

Need help with MQTT // Automation with Shelly Plug S MQTT

$
0
0

Hey. Regarding my thread I would like to try my luck with MQTT now. However, I am absolutely inexperienced with MQTT and would therefore appreciate any help!

Would someone conjure up an automation from this for me?

MQTT Topic: shellies/Trockner/relay/0/power

Original automation with a different connector that works:

alias: Nachricht - Waschmaschine fertig
description: ''
trigger:
  - platform: numeric_state
    below: '200'
    for: '00:05:00'
    entity_id: switch.0001dbe9914c9b (Info: This is my washing machine.)
    attribute: power
    above: '1'
condition: []
action:
  - service: notify.mobile_app
    data:
      title: '-- WASCHMASCHINE --'
      message: Die Waschmaschine ist fertig!
mode: single

Short: If the POWER value of the MQTT parameter is between 1 and 200 for five minutes, it should send a message to the devices I defined. The problem starts with the fact that I receive countless messages and don’t know how to change that. I would really appreciate help. Thanks!

1 post - 1 participant

Read full topic


Pre-Paid Electricity Counter

$
0
0

Hi all, I need some help with Counters and Input Numbers.

At home we have pre-paid electricity. I recently installed a Shelly EM to pull our electrical consumption through to Home Assistant, but now I want to take it a step further by syncing the pre-paid balance (standalone device) with Home Assistant, to ping us when our balance goes below a certain threshold, and to track if the energy meter of the pre-paid device is in line with the consumption tracked by the Shelly.

So I require a couple of functions.

Screenshot 2022-07-23 111617

  1. I need to be able to set the current value of the pre-paid meter. This is simple through a Counter.

  2. I need to decrease the value of the counter based on the energy consumption measured by the Shelly. In my mind, I need to measure the daily energy consumed with a utility meter, and deduct that value from the counter value just before midnight each day. If there’s a better/more frequent way to manage this I’d love to hear it.

  3. When purchasing the credits, we get a certain amount of kWh for the value purchased - this fluctuates based on total monthly consumption. This seems possible by using an Input Number and an Input Button. This number needs to be added to the Counter value.

  4. I need to ping an alert to our phones if the Counter value goes below a certain threshold. This I can do through NodeRed.

My difficulty is that in principle I know how to do this, but I just cannot get the code right.

I only really need help on Items 2 & 3, as the other ones are straightforward.

Thanks!

1 post - 1 participant

Read full topic

Getting Login attemp invalid authentication from the IP address that is the HA Host VM?

$
0
0

So in the Logs, Im seeing this in the Logs:

10.1.1.165 is the Qnap NAS, running Virtualization station.
Install is completely up to date,

The HA instance in the VM is 10.1.1.171

Logger: homeassistant.components.http.ban
Source: components/http/ban.py:125
Integration: HTTP (documentation, issues)
First occurred: 6:13:20 PM (6 occurrences)
Last logged: 6:58:50 PM

  • Login attempt or request with invalid authentication from 10.1.1.165 (10.1.1.165). (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.114 Safari/537.36 Edg/103.0.1264.62)
  • Login attempt or request with invalid authentication from localhost (127.0.0.1). (Home Assistant/2022.3 (io.robbie.HomeAssistant; build:2022.358; iOS 15.5.0) Alamofire/5.4.4).

Ive got trusted networks in .yaml as such:

#customize: !include customize.yaml
auth_providers:
- type: trusted_networks
trusted_networks:
- 10.1.1.0/24
- 127.0.0.1

- type: homeassistant 

#Mobile Application
mobile_app:

Could this also be causing issues with the iOS app dropping all of its config, ( wife’s iPhone) after about an hour? - Click on the app and the ‘Welcome’ screen appears, and need to enter everything from scratch.

Need to get this sorted - Wife approval factor decreasing!

This has worked flawlessly until about a week ago.

Thanks

Jarrod.

1 post - 1 participant

Read full topic

Home / Away / Vacation etc modes and scenes

$
0
0

I am using automations directly to implement home/away/vacation/guest and other modes.

For example, when i set the house alarm “away” when going out, the away automation triggers switching off all lights, closing all shutters etc and when i come back the “back home” automation triggers opening some shutters, some lights etc using some service templates.

I was wondering the best use case for these type of automations. Feels like i have to create home/away/vacation/guest etc scenes and in my automations i should turn on the related scene; altough i am not sure if scenes support service templates… Or should i leave them all as it is, all in automations?

Example of my current automation:

- alias: Shut Everything Down on Bedtime or Away
  trigger:
  - platform: template
    value_template: "{{is_state_attr('alarm_control_panel.area_a','stay_armed', True)}}"
  - platform: template
    value_template: "{{is_state_attr('alarm_control_panel.area_a','armed', True)}}"
  action:
  - service: light.turn_off
    entity_id: group.all_lights
  - service: media_player.turn_off
    entity_id: media_player.salon_tv
  - service: cover.close_cover
    data:
      entity_id:
      - cover.qubino_salon_pencere_level
      - cover.qubino_salon_balkon_level
      - cover.qubino_mutfak_pencere_level
      - cover.qubino_mutfak_balkon_level
      - cover.qubino_calisma_odasi_level
      - cover.qubino_cocuk_balkon_level
      - cover.qubino_misafir_level
      - cover.qubino_sinema_level
      - cover.qubino_kis_bahcesi_level
      - cover.qubino_teras_level
# SUMMER TIME:
  - service_template: >
      {%- if is_state_attr('alarm_control_panel.area_a','armed',True) -%} 
        cover.close_cover
      {%- else -%}
        script.continue
      {% endif %}
    data:
        entity_id:
          - cover.qubino_ebeveyn_level
          - cover.qubino_cocuk_pencere_level
  id: ef24667b84ff419487795ad02bbfa80f

2 posts - 2 participants

Read full topic

How to re-discover a deleted shelly device

$
0
0

I have accidentaly delete a Shelly Motion device and HA does not rediscover it. I have tried to add it manually using its name and using its ip address, but it does not work. I have tried to remove the Shelly integration and add it again, it dicovers all other Shelly device but not the one deleted.
Any idea how I can re-discover my Shelly Motion?

1 post - 1 participant

Read full topic

Configuring HA for GlowStick (MQTT / Cloud)

$
0
0

I am trying to configure my Bright GlowStick into HA but I cannot fathom it out and there are so many pieces of advice its conflating.

I have installed Mosquito & Mosquito Broker on my HA Instance (Running on an ODROID N2+, latest version)
I have MQTT configured on my glowstick by Bright

I have configured the broker with;
Broker: HA IP.
Port: 1883
Username: (New Username generated in HA users)
Password: Password for above.
Enable Discover & birth Message
Birth Message Topic: home assistant/status

Listen to a topic: SMART/HILD/[MAC]

If I run the following;

[core-ssh~]$ mosquito_sub -h glowmqtt.energyhive.com -u [username] -P [password] -t SMART/HILD/[MAC] -p 1883

I get full output with all the info.

I have tried a variety of additions into the configuration.yaml but I am getting multiple errors with them?

    - platform: mqtt                           
    name: "Home Instant Electricity"               
    state_topic: "SMART/HILD/[MAC]"               
    unit_of_measurement: 'W'
    value_template: "{{ value_json['elecMtr']['0702']['04']['00']|int(base=16) }}"
    icon: 'mdi:flash'

  - platform: mqtt 
    name: "Home Instant Export"
    state_topic: "SMART/HILD/[MAC]"
    unit_of_measurement: 'W'
    value_template: "{{ value_json['elecMtr']['0702']['00']['01']|int(base=16) }}"
    icon: 'mdi:flash'

  - platform: mqtt
    name: "Home Electricity Import Meter"
    state_topic: "SMART/HILD/[MAC]"
    state_topic: "SMART/HILD/[MAC]"
    last_reset_value_template: homeassistant.util.dt.utc_from_timestamp(0)
    unit_of_measurement: 'kWh'
    device_class: energy
    state_class: total_increasing
    value_template: "{{ value_json['elecMtr']['0702']['00']['00']|int(base=16) * value_json['elecMtr']['0702']['03']['01']|int(base=16) / value_json['elecMtr']['0702']['03']['02']|int(base=16) }}"
    icon: 'mdi:counter'

  - platform: mqtt 
    name: "Home Electricity Export Meter" 
    state_topic: "SMART/HILD/[MAC]"
    state_topic: "SMART/HILD/[MAC]"
    last_reset_value_template: homeassistant.util.dt.utc_from_timestamp(0)
    unit_of_measurement: 'kWh'
    device_class: energy
    state_class: total_increasing
    icon: 'mdi:counter'
    value_template: "{{ (value_json['elecMtr']['0702']['00']['01']|int(base=16) * value_json['elecMtr']['0702']['03']['01']|int(base=16) / value_json['elecMtr']['0702']['03']['02']|int(base=16)) }}"
    
  - platform: mqtt
    name: "Home Gas Meter M3"
    state_topic: "SMART/HILD/[MAC]"
    state_topic: "SMART/HILD/[MAC]"
    last_reset_value_template: homeassistant.util.dt.utc_from_timestamp(0)
    unit_of_measurement: m³
    value_template: "{{ value_json['gasMtr']['0702']['00']['00']|int(base=16) * value_json['gasMtr']['0702']['03']['01']|int(base=16) / value_json['gasMtr']['0702']['03']['02']|int(base=16) }}"
    icon: 'mdi:counter'
    device_class: gas
    state_class: total_increasing

UPDATE:
The error I am getting is;

String does not match the pattern of "DEPRECATED" 

This appears on every line of the MTQQ config

1 post - 1 participant

Read full topic

The 'utility_meter.select_tariff' service has been deprecated and will be removed in HA Core 2022.7

$
0
0

Hello,
I’ve got this message when running the automation:

service: utility_meter.select_tariff
data:
tariff: f2
target:
entity_id:
- utility_meter.monthly_energy

I can’t find any support in order to use select.select_option suggested… Can anyone help me ? I’m running 2022.6.6
Thanks

1 post - 1 participant

Read full topic

Template sensor with off delay is unknown after restart - remedy?

$
0
0

I have a template sensor that has an off delay of 900 s.

  - binary_sensor:
    - name: "test"
      delay_off:
        seconds: 900

After every restart of Home Assistant it stays unknown for 900 s. Is there a way to give it a default value or keeping the value so I don’t have an unknown sensor? Ideally it would save the state from before the restart which is usually right.

I know this behavior is correct, but I still want to fix that.

1 post - 1 participant

Read full topic


How to record temperature data? (Unable to find referenced entities)

$
0
0

I think I have successfully set up a webhook which receives a basic JSON payload.
The trouble is I don’t know how to capture the data.

I think I need to create an Entity which has a state. So I have defined an entity which references a state sensor.bedroom_temperature, this doesn’t quite make sense to me. Does sensor.bedroom_temperature need to be defined elsewhere? Or is it automatically created and it properties inferred?

template:
 - sensor:
     - unique_id: "9999"
       name: "Bedroom temperature"
       unit_of_measurement: "°C"
       state: >
         {% set bedroom = states('sensor.bedroom_temperature') | float(0) %}
         {{ (bedroom | round(1, default=0)) }}

Anyhow, I have defined my webhook like below and can call it, but the sensor never updates with the logs stating “Unable to find referenced entities sensor.bedroom_temperature”. I can see it in the list of entities and it is not listed as read-only.

Here is my trigger definition

- id: '1658403039386'
  alias: Update Temp
  description: ''
  trigger:
  - platform: webhook
    webhook_id: update-temp
  condition: []
  action:
    - service: input_number.set_value
      data_template:
        value: >
            {{ trigger.json.temp | float }}
      target:
        entity_id: sensor.bedroom_temperature

1 post - 1 participant

Read full topic

High accuracy Aqara detector RTCGQ13LM

$
0
0

Hello to all,
New in the world of Home Assistant, I am in the process of migrating my home automation from Jeedom to Home Assistant.

I’m slowly getting used to it, even if I’m far from having done the trick yet.

But I have a problem with a sensor I just received, it is the Aqara High Precision RTCGQ13LM.

I am using ZHA with a Conbee II, and unfortunately it is not recognized correctly.

I don’t have the battery level going back up (not too bad) but I don’t have the motion detection going back up… that’s annoying.

Is there a solution? Do I have to install in // Zigbee2MQTT where it seems to be supported? Can the 2 systems cohabit?

Thanks in advance for your help and advice.

Nice day to all.

1 post - 1 participant

Read full topic

Problems with energy sensor in Energy Dashboard

$
0
0

Hello,
I am trying to get my energy usage integrated into the Energy Dashboard and having issues with my main sensor. I use Florida Power & Light (FPL) and use a custom integration that gets various data from the FPL API. This all works well and while I don’t get hourly usage data, I do get a daily value that is updated every day around 4 or 5am in the morning.

This is sensor.fpl.dailyusagekwh. The problem I am having is that this value resets each day early morning to the previous day’s value but the energy dashboard seems to be treating it as if it should be increasing each day. So for example if today my daily value is less than yesterday, the dashboard will actually say I used negative energy.

I’m wondering if the problem is that the sensor doesn’t reset at midnight but instead of inconsistent times in the early morning and Dashboard has already done it’s daily reset or something?

The sensor is marked as total_increasing but also does have a correctly set last_reset time so it seems like it should work?

attribution: This data is provided by FPL.
integration: FPL
friendly_name: Daily Usage
device_class: energy
state_class: total_increasing
unit_of_measurement: kWh
date: 2022-07-22T00:00:00.000-04:00
last_reset: 2022-07-21T00:00:00.000-04:00
icon: mdi:flash

1 post - 1 participant

Read full topic

Get state attributes from entity by input_select

$
0
0

Hi,

I have a IKEA Strybar (4 button remote) which I want to use to toggle between lights, turn them off and on and adjust their color temperature. Therefore I have created an input_select entity containing the light entities, which I’m toggling through using the remote.

My problem is that I can’t get the current color temperature of the current selected light from input_select:

Light from input_select: {{states('input_select.selectedlight')}}
Color Temp: {{state_attr('{{states('input_select.selectedlight')}}', 'color_temp')}}

Somehow those queries cannot be nested, since the query seems to result in a string.
I was searching a lot for nested attributes, get entitity attributes by string etc. but couldn’t find anything.

I would be glad if someone could help.

Thanks!
Steffen

2 posts - 2 participants

Read full topic

Help with icon location on custom picture elements card

$
0
0

I have a picture-elements card that displays, battery level, battery state proximity location and distance to home. I’m relatively new to HA and CSS. I had everything pretty good, but wanted to scale the card down and I just cant seem to get one of the icons located properly. the icon in the top left is too far left. See my code below. I’ve played with all the variables and can get it to “move” but not correctly.grid1

type: picture-elements
image: /local/pictures/eric.jpg
elements:

  • type: state-label
    entity: device_tracker.erics_iphone
    style:
    left: 0
    bottom: 0
    pointer-events: none
    line-height: .3em
    font-size: .75em
    background-color: rgba(0,0,0,0.4)
    width: 100%
    transform: initial
    padding: 3px
  • type: state-label
    entity: proximity.home
    style:
    right: 3px
    bottom: 0
    pointer-events: none
    transform: initial
    line-height: .7em
    font-size: .75em
    padding: 0px
    ‘–paper-item-icon-color’: white
  • type: state-label
    entity: sensor.erics_iphone_battery_level
    title: Eric_battery_level
    style:
    left: 0
    top: 0
    padding: 5px
    pointer-events: none
    transform: initial
    line-height: 1em
    font-size: .75em
  • type: state-icon
    entity: sensor.erics_iphone_battery_state
    style:
    right: 0
    top: 5%
    padding: ‘-5%’
    pointer-events: none
    transform: translate(-30%, -30%) scale(.5, .5)
    line-height: 1em
    font-size: .1em
    ‘–paper-item-icon-color’: white

1 post - 1 participant

Read full topic

Z Wave JS MQTT can be very slow to respond

$
0
0

I’ve been having some issues with slow to respond Z Wave devices recently.

I’ve gone through a lot of change, so I’ll try to post as much info as I can here:
I was on Pi 3 B with SD Card but was having stability issues, so I recently swapped out nearly everything- on Pi4 B (4gbRam) booting from SSD. Same Z Wave Stick (Aeotec Z-Stick Gen5 Z-Wave Hub), plugged in with usb extension so that it is located on the ceiling of my basement in a central location to the home.

software is:
Home Assistant 2022.7.6
Supervisor 2022.07.0
Operating System 8.2
Z-Wave JS to MQTT 0.44.0

I also have a Ring alarm system so there is a second z wave mesh in my home. My main mesh has around 35 devices, mostly light switches, and my Ring mesh has around 15 items, almost all door/window sensors (along with one motion sensor, a couple flood sensors, a door lock and a smoke detector)

Attached is a debug log from a few minutes last night, where I have an automation that is supposed to turn off all downstairs lights and turn on a stairwell light. Sometimes it takes 1-2 seconds to run, last night it took over a minute.

I’m not really sure what is causing the slowness or how I could boost performance. I’ve tried healing the network, removing and re-adding a few nodes that I thought were problematic, etc. So far nothing has helped so I’m reaching out here because I’d really prefer not to go scorched-earth and just delete everything and rebuild.

in case it helps, here is a list of devices on my main mesh with the node id, description, and device model:

and here is the debug log subset (i believe) from my attempted automation last night:

happy to provide anything else or answer any questions that may help solve this. very baffling in just how inconsistent it is and driving me up a wall trying to solve for it with my minimal understanding.

1 post - 1 participant

Read full topic

MQTT auto discovery does not work any more after deleting device

$
0
0

I deleted an auto discovered device (a solar inverter, conected via openDTU) and now it won’t get re-added, even though the device sends the (I assume) correct message

MQTT Explorer shows this after powering up the openDTU dongle for example (there are many more sensors that get published):
solar/sensor/dtu_6256824562/ch0_PowerDC

`{

“name”: “Hoymiles HM-1500 1 PowerDC”,
“stat_t”: “solar/6256824562/0/powerdc”,
“unit_of_meas”: “W”,
“uniq_id”: “6256824562_ch0_PowerDC”,
“dev”: {
“name”: “Hoymiles HM-1500”,
“ids”: “6256824562”,
“cu”: “http://192.168.1.102”,
“mf”: “OpenDTU”,
“mdl”: “HM-1200, HM-1500”,
“sw”: “g0abd05c”
},
“exp_aft”: 10,
“dev_cla”: “power”,
“stat_cla”: “measurement”

}
`
(I altered the inverter serial number if someone is wondering)

Like I said - it got added the first time instantly and without any issues, but after (stupidly) deleting it, it won’t appear any more

I have gone through countless MQTT related topics by now but it didn’t help - I tried everything that got suggested - in the end most people resolved their issues by restarting one of the devices. That’s what I did too - the last thing I did was to physically unplug everything, first boot my router, then Home Assistant and after it has started completely power up the openDTU stick.

But HA does not add it any more - the stick seems to do exactly what it’s supposed to do - it sends the discovery messages, but HA won’t use them

The only logical explaination I could see is that HA thinks “well, you deleted that device with this unique_id so you probably don’t want me to add it again” … but I DO!

what else could I try?

1 post - 1 participant

Read full topic


Home Assistant access via a Cloudflare Tunnel

$
0
0

I am running Home Assistant in a Docker container on a Raspberry Pi 4. I am trying to use a Cloudflare Tunnel I set up to access my instance from a custom domain home-assistant.mydomain.com.

Since I couldn’t get a Cloudflared Docker image to work on my Raspberry Pi 4, I set up the tunnel using the Cloudflare CLI.

I also created a public hostname to be accessed via this tunnel: home-assistant.mydomain.com

However, I get the 400 bad request page:

I even tried adding the configuration in my configuration.yaml file as mentioned in the Cloudflared Addon for Home Assistant documentation:

http:
  use_x_forwarded_for: true
  trusted_proxies:
    - 172.30.33.0/24

This did not work likely because that’s for the Cloudflared Addon Docker container?

Any ideas?

I was able to successfully get a public hostname to Plex accessible via this tunnel: plex.mydomain.com though.

Does anyone know of a Cloudflared Docker image that works and a complete documentation to set it up with Home Assistant?

1 post - 1 participant

Read full topic

Use For in automation

$
0
0

Hello everybody
I’m trying to write an automation to switch on the air conditioners dynamically based on presence in the rooms and how much my solar system produces.
the second part works already give time, now I wanted to add the part of the rooms.
I am trying to use a for loop inside an entry but I am constantly getting errors.
the problem appears on the “set”.
you can use a for loop inside an automation.
if you have any advice?

this is the code

  alias: Autoaccensione condizionatori NEW
  description: ''
  trigger:
  - platform: numeric_state
    entity_id: sensor.grind_power_now
    below: '100'
    for: 00:20:00
  - platform: time_pattern
    minutes: /20
  condition:
  - condition: numeric_state
    entity_id: sensor.produzione_istantanea_fotovoltaico
    above: '500'
  - condition: time
    after: '10:30'
  action:
    {% set sorted_list = group.usostanze | expand | sort(attribute='state', reverse=true)%}
    {for state in sorted_list %}
    {% set nome = state.entity_id.split("uso_")[1] %}
    {% set valoremax = "sensor.max_consumoclima"+nome %}
    {% set valoretemp = "sensor."+nome+"_room_temperature" %}
    {% set valoreentity = "climate."+nome %}	
  - condition: template
    value_template: {{((states.sensor.produzione_istantanea_fotovoltaico.state)|float - (states.sensor.assorbimento_istantaneo_casa.state)|float - (states(valoremax))|float) >= (states.input_number.delta_fotovoltaico.state) |float }}
  - condition: state
    entity_id: {{valoreentity}}
    state: 'off'
    for: '00:15:00'
  - condition: template
    value_template: {{((states(valoretemp)) > states.input_number.temperatura_interna_max.state) or ((states(valoretemp)) < states.input_number.temperatura_interna_min.state) }}
  - service: climate.turn_on
    target:
      entity_id: {{valoreentity}}
    data: {}
  - condition: state
    entity_id: automation.spegnimentoautomaticocondizionatori
    state: 'off'
  - service: automation.turn_on
    target:
      entity_id: automation.spegnimentoautomaticocondizionatori
    data: {}
  - service: tts.google_translate_say
    data:
      entity_id: media_player.gruppo_casa
      message: avviato servizio di climatizzazione
{%- endfor -%}
  mode: single

1 post - 1 participant

Read full topic

Authenticated still working?

$
0
0

So I noticed I still get persistent notifications from authenticated upon a user logging in, so it seems to still be working? Does anyone know what I can use as an entity to trigger an automation upon a specific user logging in? Like sensor.last_user_authenticated, or sensor.last_authenticated_user or something? I’m not sure what it was called but I think it was something like that.

1 post - 1 participant

Read full topic

Frigate requires MQTT. Will that effect ZHA?

$
0
0

I have HA running in a VM on Proxmox. I’m using the ZHA integration for my (so far) one smart plug because I couldn’t get ZigbeeMQTT to recognize my Sonoff Zigbee dongle. ZHA picked it up right away.

Anyway, I want to try Frigate for my one camera but it requires MQTT. Is that related to ZigbeeMQTT? If so is there a problem running both MQTT and ZHA?

How about running in Proxmox? Any potential problems there?

1 post - 1 participant

Read full topic

Collapsible card with markup

$
0
0

Hi,

so I’m using collapsible cards in my HA setup. They work great. However, there is one limitation and I haven’t found a way around it. I can only insert a title in “plain text” in the collapsible card - meaning I can’t use markup language to insert information into the collapsing card. For example: I have a collapsing card that “hides” the alarm system keypad. Above it, I have a markup card that tells me (in “normal” language) whether the alarm is active, activating, or off. Ideally, this information would be displayed in the collapsing card, thus letting me expand upon the information provided in the collapsing card by expanding it.

Does this make sense? Anybody know a way around this limitation? Or am I missing something?


Thanks!

1 post - 1 participant

Read full topic

Viewing all 108763 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>