Help with new automation script - TH16 temperature sensor to control sonoff R3 at time intervals

Brilliant. Was half way there. Your automation code finished the piece.
We’ll see later how it works.

Thanks a lot

hmm didn’t switch on . It was 22c.
What are the requirements for config files? I have a folder for ‘generic_thermostat’ in ‘custom_components’. This has a climate.py.

Update: Maybe because I had min_temp as 21.5 and it was 22c!!! Daft I didn’t see that. I’ll try again

Configuration.yaml

climate:
  - platform: generic_thermostat
    name: downstairs
    heater: switch.switch.sonoff_100091bde7_1
    target_sensor: sensor.sonoff_1000223a99_temperature
    min_temp: 21.5
    max_temp: 24.0
    ac_mode: false
    target_temp: 23.7
    cold_tolerance: 0.2
    hot_tolerance: 0.2
    min_cycle_duration:
    seconds: 5
    initial_hvac_mode: "off"
    away_temp: 16
    precision: 0.1

automations.yaml


- id: '1588424152630'
  alias: Heating Enabled
  description: ''
  trigger:
  - at: '15:15'
    platform: time
  condition: []
  action:
  - data: {}
    entity_id: climate.downstairs
    service: climate.turn_on

Have you experimented with the thermostat using the Lovelace UI? You should do that first to understand its operation and to confirm it’s controlling the heater properly.

I’ve using the UI for the automation scripting. The climate script I coded straight into the yaml.
Still haven’t got it to work work yet

You and I, we are not talking about the same thing.

I am asking if you have tried controlling the thermostat you just created using the Thermostat card in the Lovelace UI (this particular example is from the documentation):

1 Like

Started from scratch again on a different platform. Installed Ubunto on HyperV VM. Then installed docker and hassio. Took some time as the first iso installations failed and had issues with ethernet bridges etc.

Now I have the editor from the url. Much easier. Thermostat appeared straight away once added to the config yaml

That’s good news. So where are we on resolving this issue? Have you experimented with the thermostat and now understand its operation?

Effectively the only automations required are the ones I posted above that simply enable and disable the thermostat at the desired times. The thermostat itself, when enabled, takes care of maintaining the temperature at the desired level.

Yep got there in the end. Card appears on my dash.
I can switch it off and on from the generic thermostat on the overview. Also move the dial around changing the target temp. But I assume the set temperatures are hard coded from the config file? Please correct me if I am wrong.

I’ve created the 2 automations - I’ll see later if it actions at the correct time.

Now I’m interested to try out other poeple’s versions.

Thanks!

min_temp and max_temp constrain the range of temperatures that can be set.

If you believe that one of my posts above has adequately answered your original question, please mark it with the Solution tag. This will automatically place a check-mark next to the topic’s title, signaling to others that this topic has an accepted solution. It will also place a link below your first post leading to the Solution. All of this helps others who may be searching for answers to a similar question.

1 Like

All working brilliantly. Thanks guys!

1 Like