Gnaget2 / Car-Heater-Package

Control your car engine heater with Home Assistant
10 stars 7 forks source link

Yr integragtion is no longer in homeassistant #12

Open pellle87 opened 3 years ago

pellle87 commented 3 years ago

i have tried to get it to work with met integration which i seem to have accomplished but my groups wont load when i got this package so i tried migrate the groups section from your yaml to groups.yaml which didnt work either.

Is it possible to get an update to this awesome package?

sunkan85 commented 3 years ago

this might work. I have not tested it heater fix.txt

pellle87 commented 3 years ago

Cool, ill try it out tonight :)

sunkan85 commented 3 years ago

you have to change to your switch. please confirm if it works so others can use it

pellle87 commented 3 years ago

Ok so i changed:

  heater_on:
    sequence:
    - service: light.turn_on
      entity_id: light.motorvarmare
    - service: homeassistant.turn_on
      entity_id: automation.heater_off

To:

  heater_on:
    sequence:
    - service: switch.turn_on
      entity_id: switch.driveway_socket
    - service: homeassistant.turn_on
      entity_id: automation.heater_off

and changed

  - platform: template
    sensors:
      heater_outside_temp:
        friendly_name: 'Utomhus temperatur'
        value_template: "{{ states('outside_temperature') }}"  ## Change to local temperature source

To:

  - platform: template
    sensors:
      heater_outside_temp:
        friendly_name: 'Utomhus temperatur'
        value_template: "{{ states('weather_temperature') }}"  ## Change to local temperature source

I get no errors, gonna set timer tonight and see tomorrow if it has started as supposed :)

pellle87 commented 3 years ago

Update: the switch hadnt been activated this morning Noticing sensor.heater_outside_temp reports unknown as value, so the problem is probably there

pellle87 commented 3 years ago

Changed:

sensor:

  - platform: template
    sensors:
      outside_temperature:
        friendly_name: "Outside Temperature"
        unit_of_measurement: '°C'
        value_template: "{{ state_attr('weather.home', 'temperature') }}"

To:

sensor:

  - platform: template
    sensors:
      outside_temperature:
        friendly_name: "Outside Temperature"
        unit_of_measurement: '°C'
        value_template: "{{ states('sensor.weather_temperature') }}"

Now i get the temp from sensor.outside_temperature so hopefully it will work, also i had missed changing

# Turns the heater off when leaving time is reached
  - alias: "heater off"
    initial_state: false
    trigger:
     - platform: time_pattern
       minutes: '/5'
       seconds: 2
    condition:
      - condition: template
        value_template: "{{ ((as_timestamp(now()) | int | timestamp_custom('%H:%M')) == states('sensor.engineheaterofftime')) }}"
    action:
       **- service: light.turn_off
         entity_id: light.motorvarmare**
       - service: homeassistant.turn_off
         entity_id: automation.heater_off
sunkan85 commented 3 years ago

you can go to config / automation and run heater +1 to force start it so you do not have to wait to see if it works remember to restart HA after changing the file

pellle87 commented 3 years ago

you can go to config / automation and run heater +1 to force start it so you do not have to wait to see if it works remember to restart HA after changing the file

It turned on the switch.driveway_socket entity so seems to be working or did it... i got departure time 11:40, shouldnt that only switch it on if theres < 1h to departure since outside temp is -7,7c

sunkan85 commented 3 years ago

if forced start an automation it start the one you choose. did you take the main script maybe it sees in the history what the temp was 02:00

pellle87 commented 3 years ago

if forced start an automation it start the one you choose. did you take the main script maybe it sees in the history what the temp was 02:00

Ah yea i forced the 1h, stoopid me :) i have set the departure time to 10:30 now and executed the heater enable automation to se if it will auto start the switch, the temp is -8.4 now so should be started 9:30 if i understand the script correct

pellle87 commented 3 years ago

Confirmed working Thanks alot!

sunkan85 commented 3 years ago

no problem. I upload the whole cod fix so maybe more people will avoid problems. I have spent a lot of time fixing this

pellle87 commented 3 years ago

no problem. I upload the whole cod fix so maybe more people will avoid problems. I have spent a lot of time fixing this

Awesome! thanks for the help :)

msex67 commented 3 years ago

I belive i have this problem, on how to configure for a local temp sensor. ( not YR ) /Micke

Gnaget2 commented 2 years ago

I’m no longer using this function my self so not doing any changes to this package but hope others can help