Home Assistant : Q&A, Tips & Tricks, Your Configs

Veroland

Executive Member
Joined
Aug 24, 2005
Messages
6,072
Xiaomi zigbee stuff seems to be by far the best on the market, except the gateway. Sonoff stuff works, but feels a bit cheap and clunky.
I have 2 Xiaomi temp sensors and the one seems to lose connection every now and then, I don't have the same problem with any of my Sonoff temp sensors
 

MidnightZA

Expert Member
Joined
Mar 9, 2013
Messages
1,659

This got released today. Much cheaper than I expected.
If anyone in Durban is importing one , let me know please
 

gbyleveldt

Senior Member
Joined
Apr 30, 2009
Messages
829
Yeh, think that'll be the easiest. Probably should have spent more time looking up what I wanted to do. All this just to monitor bedroom humidity.
I only wanted presence and humidity detection in the bathrooms, it's now become much more complex of course. All my stuff is wifi, but there's a lot to be said for simple and small zigbee devices as well. I also ordered more from BG, but it was part of that shipment that go stolen at customs so I have to order again...
 

Veroland

Executive Member
Joined
Aug 24, 2005
Messages
6,072
I only wanted presence and humidity detection in the bathrooms, it's now become much more complex of course. All my stuff is wifi, but there's a lot to be said for simple and small zigbee devices as well. I also ordered more from BG, but it was part of that shipment that go stolen at customs so I have to order again...
Zigbee sounds like a good wat, those batteries last a very long time.

I just don't know how a device (any) will cope with the moisture in the bathroom
 

calypso

Expert Member
Joined
Feb 10, 2009
Messages
1,734
Zigbee sounds like a good wat, those batteries last a very long time.

I just don't know how a device (any) will cope with the moisture in the bathroom
I have a Xiaomi temp/humidity sensor in my shower for turning on the extractor. Over 2 years old and still working fine. Can't remember if I have changed the battery yet.
 

Veroland

Executive Member
Joined
Aug 24, 2005
Messages
6,072
I have a Xiaomi temp/humidity sensor in my shower for turning on the extractor. Over 2 years old and still working fine. Can't remember if I have changed the battery yet.
Good to know. thanks. I have recently had to replace my batteries in the Xiaomi temp sensors after 18 months or so.
 

AmazeBalls

Member
Joined
Jul 13, 2013
Messages
17
can someone lend a hand. Been running HA for a few months after moving from Homebridge. Got everything up and running but one thing I have had issues setting up is my automations. Some work and some don't and cant seem to figure out why. Simple automations such as turning on lights after sunset with an offset, turning fans on based on temps don't trigger. Others like snapshots of camera motions work fine. Any suggestion will be appreciated

Here is one of them:

Code:
alias: Front door lights - on
description: Turn fron door lights -00h30 after sunset
trigger:
  - platform: sun
    event: sunset
    offset: '00:30'
condition: []
action:
  - service: light.turn_on
    target:
      entity_id: switch.sonoff_10010b3c58
mode: single

my config.yaml:

Code:
# Example configuration.yaml entry
default_config:
cloud:
config:
counter:
dhcp:
history:
image:
logbook:
map:
media_source:
mobile_app:
my:
person:
stream:
sun:
system_health:
updater:
discovery:
http:
  base_url: https://myurl
  ssl_certificate: /ssl/fullchain.pem
  ssl_key: /ssl/privkey.pem
 
automation mine: !include_dir_list automation/
scene: !include scenes.yaml
scene mine: !include_dir_list scenes/
shell_command: !include_dir_merge_named shell_commands/
device_tracker: !include_dir_list device_tracker/
proximity: !include_dir_merge_named proximity/
binary_sensor: !include_dir_merge_list binary_sensors/
tts:
  - platform: google_translate
group: !include groups.yaml
script: !include scripts.yaml
automation: !include automations.yaml
 

AmazeBalls

Member
Joined
Jul 13, 2013
Messages
17
light.turn_on won't turn a "switch" on.

Use the switch.turn_on
:X3:haha that makes sense. thanks. Now I know why some worked and other didn't.

While we at it, having an issue with this one based on motion. It turns on correctly but the turn off automation doesnt trigger.

Code:
alias: Garage Light - off
description: Turn garage light off based on no motion
trigger:
  - platform: state
    entity_id: binary_sensor.motion_garage
    from: 'on'
    to: 'off'
    for:
      hours: 0
      minutes: 0
      seconds: 0
      milliseconds: 0
condition: []
action:
  - service: switch.turn_off
    target:
      entity_id: switch.sonoff_1001043f9b
mode: single

and another. except to turn on a fan based on temp

Code:
alias: Joshua Fan on
description: turn Joshua’s fan on if temp is above 25 degress
trigger:
  - platform: numeric_state
    above: '25'
    for:
      hours: 0
      minutes: 0
      seconds: 0
      milliseconds: 0
    entity_id: sensor.sonoff_a48000ca10_temperature
condition: []
action:
  - service: switch.turn_on
    target:
      entity_id: switch.sonoff_1001230dd0
mode: single
 

Speedster

Honorary Master
Joined
May 2, 2006
Messages
15,720
:X3:haha that makes sense. thanks. Now I know why some worked and other didn't.

While we at it, having an issue with this one based on motion. It turns on correctly but the turn off automation doesnt trigger.

Code:
alias: Garage Light - off
description: Turn garage light off based on no motion
trigger:
- platform: state
entity_id: binary_sensor.motion_garage
from: 'on'
to: 'off'
for:
hours: 0
minutes: 0
seconds: 0
milliseconds: 0
condition: []
action:
- service: switch.turn_off
target:
entity_id: switch.sonoff_1001043f9b
mode: single

and another. except to turn on a fan based on temp

Code:
alias: Joshua Fan on
description: turn Joshua’s fan on if temp is above 25 degress
trigger:
- platform: numeric_state
above: '25'
for:
hours: 0
minutes: 0
seconds: 0
milliseconds: 0
entity_id: sensor.sonoff_a48000ca10_temperature
condition: []
action:
- service: switch.turn_on
target:
entity_id: switch.sonoff_1001230dd0
mode: single
Have you tried the code without the "for" field?
 

AmazeBalls

Member
Joined
Jul 13, 2013
Messages
17
clear from field
Thanks, did the change and still wont turn off. If I run the trigger manually it turns off but not based on the 30s interval. updated config

Code:
alias: Garage Light - off
description: Turn garage light off based on Unifi motion detection
trigger:
  - platform: state
    entity_id: binary_sensor.motion_garage
    to: clear
    for:
      hours: 0
      minutes: 0
      seconds: 30
      milliseconds: 0
condition: []
action:
  - service: switch.turn_off
    target:
      entity_id: switch.sonoff_1001043f9b
mode: single
 

SauRoNZA

Honorary Master
Joined
Jul 6, 2010
Messages
40,804
Xiaomi zigbee stuff seems to be by far the best on the market, except the gateway. Sonoff stuff works, but feels a bit cheap and clunky.

What about their Aqara stuff? That looks pretty ninja.

Also brings HomeKit integration which I really like.

But I’m yet to go Zigbee.
 

calypso

Expert Member
Joined
Feb 10, 2009
Messages
1,734
What about their Aqara stuff? That looks pretty ninja.

Also brings HomeKit integration which I really like.

But I’m yet to go Zigbee.
They kinda interchange the terms. Xiaomi/Aquara same same for the most part.
 

SauRoNZA

Honorary Master
Joined
Jul 6, 2010
Messages
40,804
They kinda interchange the terms. Xiaomi/Aquara same same for the most part.

Yeah I know it’s the same mothership overshadowing it all but I do find the product lines are different enough between the two brands.
 

w1tw0lf

Senior Member
Joined
Sep 29, 2009
Messages
992
Thanks, did the change and still wont turn off. If I run the trigger manually it turns off but not based on the 30s interval. updated config

Code:
alias: Garage Light - off
description: Turn garage light off based on Unifi motion detection
trigger:
  - platform: state
    entity_id: binary_sensor.motion_garage
    to: clear
    for:
      hours: 0
      minutes: 0
      seconds: 30
      milliseconds: 0
condition: []
action:
  - service: switch.turn_off
    target:
      entity_id: switch.sonoff_1001043f9b
mode: single

Did you trigger the motion and wait 30s ?

That should work correctly. When editing the automation, look at show traces, will show where it fails.
 

AmazeBalls

Member
Joined
Jul 13, 2013
Messages
17
Did you trigger the motion and wait 30s ?

That should work correctly. When editing the automation, look at show traces, will show where it fails.
Ya constantly stays on, checked the traces, seems its the state of the binary that is not executing:

" This node was not executed and so no further trace information is available."

Code

Code:
platform: state
entity_id: binary_sensor.motion_garage
to: Clear
for:
  hours: 0
  minutes: 0
  seconds: 30
  milliseconds: 0
 

AmazeBalls

Member
Joined
Jul 13, 2013
Messages
17
Ya constantly stays on, checked the traces, seems its the state of the binary that is not executing:

" This node was not executed and so no further trace information is available."

Code

Code:
platform: state
entity_id: binary_sensor.motion_garage
to: Clear
for:
  hours: 0
  minutes: 0
  seconds: 30
  milliseconds: 0
got it wokring by changing the trigger from "on" and to "off" seems it wasnt picking up the "clear" part
 

w1tw0lf

Senior Member
Joined
Sep 29, 2009
Messages
992
Check the state of the "binary_sensor.motion_garage", what state is shown when motion is detected and cleared.

Mine switches between "Detected" and "clear" which is the default for motion sensor.
 
Top