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

How to format condition

$
0
0

I am using a condition to get some information about the weather and a forecast but now it started showing an error:
2022-04-29 13:08:45 WARNING (MainThread) [homeassistant.helpers.template] Template warning: ‘strptime’ got invalid input ‘2022-05-04T12:00:00’ when rendering template ’ {{as_timestamp(strptime(state_attr(‘weather.smhi_home’, ‘forecast’)[5].datetime, ‘%Y-%m-%d %H:%M:%S’)) | timestamp_custom("%a %-d") }}
<ha-icon icon={{states(‘sensor.weather_smhi_icon5’)}}>
{{state_attr(‘weather.smhi_home’, ‘forecast’)[5].temperature}} / {{state_attr(‘weather.smhi_home’, ‘forecast’)[5].templow}} ’ but no default was specified. Currently ‘strptime’ will return ‘2022-05-04T12:00:00’, however this template will fail to render in Home Assistant core 2022.1

This is what I’ve added to configuration.yaml a long time ago:
{% set state = state_attr(‘weather.smhi_home’,‘forecast’)[5].condition %}
{% set weather = mapper[state] if state in mapper else ‘sunny-alert’ %}
mdi:weather-{{weather}}

1 post - 1 participant

Read full topic


Local pages not secure

$
0
0

My Supervised HA has been loading pages securely from day 1 over 18 months ago just using the default 8123 port and inbuilt config. I.e. I knew nothing about security certificates and had not done anything beyond initial default config. I would enter the local IP address in any browser and the pages would load securely.
A few days ago I wanted to make a small change to an ESPHome device yaml file but the file would not install as it could not find the device wifi IP address despite HA controlling the device ok.
(Error resolving IP address: Cannot start mDNS sockets, is this a docker container without host network mode?, [Errno -5] No address associated with hostname)
Rather confused at this point as I did not (and still don’t) know what had changed.
After trying a few things with HA re-starts in between I decided to reboot the host Raspi4.
Out of the blue browser pages would not load securely! I would have to enter https://192.168.1.29:8123 to get the page to load at all and it then alerts that the page is not secure. If I recall correctly the message was Certificate not valid.
After a bit of research I decided that maybe my certificates had expired. I tried refreshing through an unused DuckDNS addon but could not get anything to refresh. I decided to uninstall the addon and re-install and found from the log that the certificates had now been refreshed but I had to copy them to the /ssl/ folder from /etc/letsencrypt folder location. I also changed what was probably an incorrect port forward so that ports 80 and 443 would forward to 8123 for this local IP address.
On re-starting I could get a secure page using mydomain.duckdns.org but still have no secure local page loading.
My Grafana charts also reports
“Unable to load iframes pointing at websites using http: if Home Assistant is served over https:.”

In configuration.yaml I have

http:
  base_url: https://192.168.1.29
  ssl_certificate: /ssl/fullchain.pem
  ssl_key: /ssl/privkey.pem
  ip_ban_enabled: true
  login_attempts_threshold: 5  

On security certificates I remain a noob and would seek some help getting back to what was reliable local page loading.
TIA

1 post - 1 participant

Read full topic

Switch off command autoamtion doesn't work

$
0
0

any idea why the last off command doesn’t apply- it is my irrigation system ?

alias: Hashkaya
description: ''
trigger:
  - platform: time
    at: '06:00:00'
condition:
  - condition: time
    before: '00:00:00'
    weekday:
      - sun
      - tue
      - thu
    after: '00:00:00'
action:
  - type: turn_on
    device_id: d202923372849746f0ab3c3247cd6de4
    entity_id: light.watering_system_on_off_2
    domain: light
  - delay:
      hours: 0
      minutes: 20
      seconds: 0
      milliseconds: 0
  - type: turn_off
    device_id: d202923372849746f0ab3c3247cd6de4
    entity_id: light.watering_system_on_off_2
    domain: light
  - type: turn_on
    device_id: d202923372849746f0ab3c3247cd6de4
    entity_id: light.watering_system_on_off_3
    domain: light
  - delay:
      hours: 0
      minutes: 20
      seconds: 0
      milliseconds: 0
  - type: turn_off
    device_id: d202923372849746f0ab3c3247cd6de4
    entity_id: light.watering_system_on_off_3
    domain: light
  - type: turn_on
    device_id: d202923372849746f0ab3c3247cd6de4
    entity_id: light.watering_system_on_off_4
    domain: light
  - type: turn_on
    device_id: 850607c94f1c3f1e98efdc20e7d06c05
    entity_id: light.t3_water_system_on_off
    domain: light
  - delay:
      hours: 0
      minutes: 20
      seconds: 0
      milliseconds: 0
  - type: turn_off
    device_id: d202923372849746f0ab3c3247cd6de4
    entity_id: light.watering_system_on_off_4
    domain: light
  - type: turn_off
    device_id: 850607c94f1c3f1e98efdc20e7d06c05
    entity_id: light.t3_water_system_on_off
    domain: light
mode: single

connected to this switch

3 posts - 2 participants

Read full topic

How to calculate energy based on time?

$
0
0

Hi,
I want to calculate the energy consumed for my electric floor heating and show it on the Energy panel.

Now, I have this solution:
Calculate the time how much has been turned on:

sensor:
  - platform: history_stats
    name: Heating time Living floor
    entity_id: binary_sensor.heating_living_floor
    state: "on"
    type: time
    start: "{{ 0 }}"
    end: "{{ now() }}"

Then, calculate consumed the energy (based on linear consumption of 2100 W):

template:
  - sensor:
      - name: "Energy Heating Living floor today"
        device_class: energy
        state_class: total_increasing
        unit_of_measurement: "kWh"
        state: "{{ float(states.sensor.heating_time_living_floor.state) * 2.1 }}"

But…:
The entity Energy Heating Living floor worked well for some first days but after some weeks it starts to calculate bad results - see screenshot below:


So, it calculates negative consumption. I think it’s because of those jumps down every day. And I think it’s because of erasure based on recorder.auto_purge. it will probably go wrong heating_time_living_floor sensor. I’m on the right track?

Please how can I correctly calculate this energy consumption (based on time) to work properly on Energy panel?

Thank you!

1 post - 1 participant

Read full topic

Zwave frustrations

$
0
0

So I’ve been migrating from Smartthings to HA, so far so good, up to the point I started trying to migrate zwave devices (locks and switches)

I have the nortek zigbee/zwave stick, and I installed zwave JS to MQTT, and I’m having a hard time adding devices.

So far I’ve tried with three, a outdoor plug, a yale lock, and a jasco switch. The lock will add, and immediately become unavailable, I’ve not been able to operate it at all. The out door plug adds, but it forever hangs in “interviewing device” and its listed, but with no options. Finally, the jasco switch, that one wont even add.

I’m running HA on a raspberry pi 4 which is located right next to the smartthigns hub, so range shouldnt be the issue. All of the mentioned devices add just fine to smartrthings.

I ordered a zoos zwave stick to rule out hardware issues, also, if all else fails, I “could” keep smartthings exclusively to act as a zwave bridge and do all my automations in HA, but that would defeat half the reason of moving to HA. Any help is appreciated.

2 posts - 2 participants

Read full topic

Zigbee2MQTT - Waxman sensor showing temp/battery but water 'unknown'

$
0
0

Moved from ZHA to Zigbee2MQTT and all working better except my one Waxman water sensor.
It shows the correct icon in the Devices screen and reports temp and battery but water is ‘unknown’
I can’t find any way to edit the device to show water/moisture status. From looking around I believe it reports as True/False but not sure how to set that independently.
Alternative would be to change it to act like a different moisture sensor but haven’t found a way to do that in the Zigbee2MQTT frontend either.
Thanks

1 post - 1 participant

Read full topic

IKEA Tradfri Motion Sensor with Sonoff 3.0 USB Plus stick compatibility?

$
0
0

Anyone using the IKEA Tradfri Motion Sensor with Sonoff Zigbee 3.0 USB Plus stick here ?

I have both here, but find the IKEA sensor doesn’t seem to be giving me much info via ZHA after succesful binding. No battery value and not much in the way of motion triggers after it’s been running for a while (like a day). At the moment the sensor entity is reporting as unavailable for some days even though it’s in a human traffic area and close to the Sonoff coordinator.

Can anyone confirm that these work (Sonoff and ZHA), any info I can find is quite old ?

I’ve updated the Sonoff firmware to the latest Zstack 20220219 build already.

1 post - 1 participant

Read full topic

GE ZW4002 Smart Fan Switch - Fan speeds are all wrong

$
0
0

I’ve been searching and I cannot find the answer to this. I have a GE ZW4002, and if it’s manually turned on, the first setting does nothing to the fan. The second setting barely moves the fan, and the third setting it’s at 100% speed. It’s also useless through voice commands, which is the rest of the families preferred method to control it.

I’ve looked and looked, but I cannot find how to adjust this, or even if it’s adjustable. The only way I can make it useable, is through custom buttons in the dashboard, and automations, and that’s only because I can call the service with a percentage.

Speaking of that, the fan only rotates, if the percentage is set to 66% or higher.

Hopefully someone has som advice on how to fix this, and change the scaling of the switch.

I use the latest Home Assistant, and Zwave.js.

There’s also not much in the way of configuration in the dashboard -

1 post - 1 participant

Read full topic


How to "Delay until..." in a automation

$
0
0

I’m writing an automation for a robot vacuum which after performing mopping, waits at a location for the mop to be removed. After arriving at location, I send a notify message via Alexa and then want to perform a loop reminding to remove the mop every 20 mins if it hasn’t been done yet.

The below code partly works, however it doesn’t immediately exit the delay/loop after removing the mop, instead, it waits for the remainder of the 20min delay; I want to continue with the next part of the automation (send her back to the dock) as soon as the mop sensor changes, any ideas appreciated!?

repeat:
  while:
    - condition: state
      entity_id: binary_sensor.sandy_mop_attached
      state: 'on'
      for:
        hours: 0
        minutes: 20
        seconds: 0
  sequence:
    - service: notify.alexa_media_everywhere
      data:
        data:
          type: announce
          method: speak
        message: Sandy is still waiting near the sink for the mop pad to be removed.
    - delay:
        minutes: 20
  - service: vacuum.return_to_base
    data: {}
    target:
      entity_id: vacuum.sandy

1 post - 1 participant

Read full topic

Image the spotify un image card

$
0
0

Hello everyone. Is it possible to change the image in an image card with the image that the media player card has?
I would like to see the image of what is being reproduced.
Thank you

type: vertical-stack
cards:
  - type: picture
*******
    media: /api/media_player_proxy/media_player.spotify?token=xxxxx
*******
    tap_action:
      action: none
    hold_action:
      action: none
  - type: custom:mushroom-media-player-card
    entity: media_player.spotify
    use_media_info: true
    use_media_artwork: true
    volume_controls:
      - volume_mute
      - volume_set
      - volume_buttons
    media_controls:
      - on_off
      - shuffle
      - previous
      - play_pause_stop
      - next
      - repeat

1 post - 1 participant

Read full topic

Device turns on directly but not in a scene?

$
0
0

I have several TP-Link switches (I can’t wait to replace them though!). When I turn them all on via a scene, one of them doesn’t turns on. However, if I turn them all one by one or even all at once, they all turn on normally.

Why do you think that is?

Let me attach the relevant code and screenshots to explain this better. I am new to this community (installed HA a few days ago, yay!), so apologies for the beginner question. I configured this all via the UI, so it’s all probably fairly standard.

This is my scene (code and screenshot):

  name: All Lights On
  entities:
    switch.bed_light:
      friendly_name: Bed Light
      state: "on"
    light.living_room_lamp:
      supported_color_modes:
        - brightness
      friendly_name: Living Room Lamp
      supported_features: 32
      color_mode: brightness
      brightness: 97
      state: "on"
    switch.entrance_lamp: # This is the one that fails
      friendly_name: Entrance Mini Light
      state: "off"

If I turn it on with the scene, the Entrance Mini Light switch won’t turn on or off.

However, if I turn it on independently or through this card in a dashboard, it does turn on and off normally:

      - type: vertical-stack
        cards:
          - type: entities
            entities:
              - scene.sleep
              - scene.sunset
            title: Scenes
            state_color: false
          - type: entities
            entities:
              - switch.bed_light
              - switch.entrance_lamp
              - light.living_room_lamp
            title: Lights
            state_color: true

I recently assigned static IPs to these devices in my router config.

1 post - 1 participant

Read full topic

Image the spotify in image card

$
0
0

Hello everyone.
I’m trying to show the spotify image in an image card but I don’t know how to make it change by itself when the song changes. If you know please I would like to know how. Thank you very much

type: vertical-stack
cards:
  - type: picture
    image: >-
      /api/media_player_proxy/media_player.spotify?token=xxxxxxxx
    tap_action:
      action: none
    hold_action:
      action: none
    theme: Mushroom
  - type: custom:mushroom-media-player-card
    entity: media_player.spotify
    use_media_info: true
    use_media_artwork: true
    volume_controls:
      - volume_mute
      - volume_set
      - volume_buttons
    media_controls:
      - on_off
      - shuffle
      - previous
      - play_pause_stop
      - next
      - repeat

1 post - 1 participant

Read full topic

Home assistant docker - Cloud connection (dns) problems

$
0
0

I seem to have some connectivity issues and I don’t know how to troubleshoot this in HA.
I have running multiple docker containers and also running Home Assistant as container, but I am struggling with reliability of the connections which connect to the internet (cloud). On every integration which needs the cloud I am having problems at random times. From within the Ha docker container I sometimes can’t resolve a hostname for a random period of time. These are my errors:

Rdw:
socket.gaierror: [Errno -3] Try again

Spotify:
socket.gaierror: [Errno -3] Try again

Wunderground (custom):
gaierror(-3, ‘Try again’))

Afvalwijzer (custom):
Failed to establish a new connection: [Errno -3] Try again’))")),)

CO2 Signal:
Failed to establish a new connection: [Errno -3] Try again’)); Retrying in background

SpeedTest:
Config entry ‘SpeedTest’ for speedtestdotnet integration not ready yet: <urlopen error [Errno -3] Try again>; Retrying in background

Growatt:
Failed to establish a new connection: [Errno -3] Try again

Etc. Etc.

Al internal connections on IP are really stable. The gai error stands for getaddrinfo(). So it has something to do with DNS. My docker container is running in host mode. My firewall is not blocking anything.

I have no other networking issues. Any ideas how to troubleshoot or resolve this? What I have tried so far:

  • I have tried many different DNS servers from Google, Cloudfare, internal etc. But all of this is not resolving this problem.
  • I have tried to connect to the internet through a Wifi hotspot on my mobile. This results in the same behavior. So I am concluding that it has nothing to do with the internet connection.

Does this have something to do with the HA docker instance? Is there a way to increase DNS retries?

1 post - 1 participant

Read full topic

Curtain Motor - unsupported

$
0
0

Hi there,

I’ve got a automated curtain which should support Zigbee. But i won’t get it to work with Home assistant.
I already tried the following things: ZHA and Zigbee2mqtt (made a completely fresh start integrated al my zigbee devices only to find out it still doesn’t work).

The brand and type of the motor are: Model YS-MT750 manufactured by Yushun

Currently I’m back on ZHA.

I’m using this curtain motor:
afbeelding

This is the zigbee signature:

{
  "node_descriptor": "NodeDescriptor(logical_type=<LogicalType.Router: 1>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.AllocateAddress|RxOnWhenIdle|MainsPowered|FullFunctionDevice: 142>, manufacturer_code=4417, maximum_buffer_size=66, maximum_incoming_transfer_size=66, server_mask=10752, maximum_outgoing_transfer_size=66, descriptor_capability_field=<DescriptorCapability.NONE: 0>, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=False, *is_full_function_device=True, *is_mains_powered=True, *is_receiver_on_when_idle=True, *is_router=True, *is_security_capable=False)",
  "endpoints": {
    "1": {
      "profile_id": 260,
      "device_type": "0x0051",
      "in_clusters": [
        "0x0000",
        "0x0004",
        "0x0005",
        "0xef00"
      ],
      "out_clusters": [
        "0x000a",
        "0x0019"
      ]
    },
    "242": {
      "profile_id": 41440,
      "device_type": "0x0061",
      "in_clusters": [],
      "out_clusters": [
        "0x0021"
      ]
    }
  },
  "manufacturer": "_TZE200_r0jdjrvi",
  "model": "TS0601",
  "class": "zigpy.device.Device"
}

Is there a way to get it to work in ZHA? I’m relatively new to HA so hopefully there is a simple guide to follow to get this to work.

Hopefully someone can help.

1 post - 1 participant

Read full topic

Cloud say message with nested if statements

$
0
0

I’m havind difficulty debugging my message:

service: tts.cloud_say
data:
  entity_id: media_player.woonkamer
  message:
    Op dit moment is het {{ states('sensor.knmi_thuis_omschrijving') }} met een temperatuur van {{ state_attr('weather.knmi_thuis', 'temperature') | float | round(1, "half") | replace('.0','') }} graden en een gevoelstemperatuur van {{ states('sensor.knmi_thuis_gevoelstemperatuur') | float | round (1, "half") | replace('.0','') }} graden. 
    De voorspelling voor vandaag is {{ states('sensor.knmi_thuis_korte_dagverwachting') }}. 
    {% if states('sensor.current_uv_index') | float <= 2 %}
      Er is vandaag vrijwel geen zonkracht.
    {% elif states('sensor.current_uv_index') | float >= 2 and states('sensor.current_uv_index') | float <= 4 %}	
      De zonkracht is vandaag zwak.
    {% elif states('sensor.current_uv_index') | float >= 4 and states('sensor.current_uv_index') | float <= 6 %}	
      De zonkracht is vandaag matig
    {% elif states('sensor.current_uv_index') | float >= 6 and states('sensor.current_uv_index') | float <= 8 %}	
      De zonkracht is vandaag sterk.
    {% elif states('sensor.current_uv_index') | float >= 8 %}	
      De zonkracht is vandaag bijzonder sterk.	  
    {% endif %}  
    Het advies is om niet langer dan {{ states('sensor.skin_type_2_safe_exposure_time') }} in de zon te zijn.

When I copy/paste it into the Template-tab of the Developer Tools is outputs:

service: tts.cloud_say
data:
  entity_id: media_player.woonkamer
  message:
    Op dit moment is het Geheel bewolkt met een temperatuur van 12.5 graden en een gevoelstemperatuur van 10.5 graden. 
    De voorspelling voor vandaag is Vrij veel bewolking, lokaal zon en op de meeste plaatsen droog. 
    	
      De zonkracht is vandaag matig
      
    Het advies is om niet langer dan 40 in de zon te zijn.

And when I run it in the Services-tab it’ll play the message upon “Op dit moment is het Geheel bewolkt met een temperatuur van 12.5 graden en een gevoelstemperatuur van 10.5 graden. De voorspelling voor vandaag is Vrij veel bewolking, lokaal zon en op de meeste plaatsen droog.” it doesn’t play the rest. I’ve tried putting the message inside a data_template, added >- after message: but that didn’t work. Can anyone explain where I’ve missed the exit?

1 post - 1 participant

Read full topic


Light turning off on its own

$
0
0

Weird new issue Zwave JS Current version: 0.1.57.

I have a light using a GE Zwave switch which is not controlled by any automations.

When I turn on the light it turns off a few seconds later and shows turned off by Supervisor.

Nothing I have tried reboots, restart zwave have showed any resolution.

1 post - 1 participant

Read full topic

Shelly 2.5 - Cover closes by itself with every HA restart

$
0
0

Hi,
I have a dozen Shelly 2.5 controllers, all setup the same way as window roller shutter controls.

One of these closes every time I restart HA core, and I can’t find any setting that pertains to this.

I’ve checked in the Shelly device settings web config page and they’re the same as the other controllers.

Any pointers?

Thank you

1 post - 1 participant

Read full topic

Studio Code Server

$
0
0

Is it worth making the switch from the inbuilt File editor?

I like the way it shows spacing errors better etc, but im having a hard time getting all the red from VSC. If I fix some of the red bits I fail config check on bits that are clearly working ???

Was looking for something to help as I get to grips with YAML but this confuses me more if its marking things wrong that are not wrong…

1 post - 1 participant

Read full topic

Devices, Areas not shown in Targets

$
0
0

I have several Insteon light switches that appear in the Devices section but do not appear in the Targets section when I try to set up Automations. The same applies to some Areas and Entities. I tried deleting and then re-adding the Area, but that didn’t fix it.

Most other devices and areas work fine. I’m on Windows 10 with an Insteon 2245 hub.

Any suggestions would be appreciated. Thanks.

1 post - 1 participant

Read full topic

Copy Energy Dashboard to Water Dashboard

$
0
0

image

The Built-in energy dashboard is great with all the options to show by day, week month and year.
I have a water meter (just started) that I would like to do the exact same with.

Anyone with ideas?

1 post - 1 participant

Read full topic

Viewing all 100930 articles
Browse latest View live


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