Shelly 1 used on a fire

Hi guys.

Iv got a Shelly 1 connected to the button that turns the leds on in my electric fire and have it set up to trigger the relay for .1 second and then turn off this turns the lights on and trigger it again to turn the lights off. Works great apart from home assistant doesn’t know if the fire is on or off only that the Shelly has been triggered. Is there anyway to make home assistant know when the fire is on or off?

Maybe with a counter odd number or times the Shelly has been toggled = fire on, even number of times the Shelly has been toggled = fire off?

Any ideas would really be appreciated.

You could use an input_boolean and when you trigger the first time it is on. When you turn off you set the input_boolean to off.

In configuration.yaml set the boolean;

# boolean input control variables
fire_state:
  name: fire state

Then you can condition on the boolean in the automation.

Alternatively you could put a light or temperature sensor (ideally paired with another one somewhere near by) near the fireplace and see if you can detect either the light from the flames (probably hard) or the change in temperature compared to ambient temperature…

Thanks for the advice.

Iv tried to do this as I think what you are saying is the right way to go I’m just struggling to get it set up I’m not the best when it comes to yaml.

Would you be able to give me a little bit more help with it please.

Can you share the yaml you have now and how you do configuration.yaml; i.e. do you use !include in your configuration.yaml?

no i havent used include in any of my configuration.yaml.

only done very basic stuff like adding wake to lan and changing switches to light etc. very basic stuff sorry.

Lets create a helper first.

Go to Automations and Scenes in Configuration
Go to helpers
Add a Helper like this:

Create the helper
Go to Automation
Create an automation like this but using your entities

alias: Set Fire_on
description: Set the input_boolean when fire turned on and off
mode: single
trigger:
  - platform: state
    entity_id: binary_sensor.family_room_fireplace_input
    id: fire_on
    from: 'on'
    to: 'off'
condition: []
action:
  - service: input_boolean.toggle
    target:
      entity_id: input_boolean.fire_on

This will set the condition of fire on and fire off.

It can get out of sink with the actual condition of the fireplace if you reboot etc.

Does this help?

Do you have a shelly pm? This would allow you to monitor power and you could skip this and always know when it was on or off.

this has worked perfectly. thank you so much