yp87 / leaf2mqtt

Pull in data from the Nissan Connect platform for the LEAF and publish over MQTT
GNU General Public License v3.0
42 stars 39 forks source link

How to start the Airco with celcius attributes. #35

Closed jkulker closed 2 years ago

jkulker commented 2 years ago

Hi there,

I try this for my switch sensor but it is not working:

switch:
  - platform: mqtt
    name: "leaf_climate"
    state_topic: "leaf/climate/runningStatus"
    command_topic: "leaf/command/climate"
    state_on: "true"
    state_off: "false"
    payload_on: "{{'startC ' + state_attr('climate.nissan_leaf_2', 'temperature') | string() }}"
    payload_off: "stop"
    icon: mdi:hvac

Any ideas how to implement this correctly

Krolykke commented 2 years ago

With a number helper named leaf_aircon_temperature_helper (adjust its value on a entity card) and a button card, this works like a charm:

show_name: true show_icon: true type: button tap_action: action: call-service service: mqtt.publish data: topic: leaf/command/climate payload_template: >- startC {{ states('input_number.leaf_aircon_temperature_helper') | float | round() }} target: {} entity: sensor.leaf_climaterunningstatus icon: mdi:air-conditioner show_state: true name: AC - Start heat @ icon_height: 50px

Skærmbillede 2022-09-24 kl  20 34 27

Sorry for the poorly inserted code.

Krolykke commented 2 years ago

@yp87 I guess you can close this, its not an issue, its a help request and its answered :-)