MQTT Sensor outputting payload in apostrophes

Hi, I have the following config:

#Garage Door Status   
  - platform: mqtt
    name: garage_door_time
    state_topic: "garadget/APGarageDoor/status"
    value_template: ‘{{ value_json.time }}’ 
  - platform: mqtt
    name: Wifi Strength
    state_topic: "garadget/APGarageDoor/status"
    value_template: ‘{{ value_json.signal }}’          
    unit_of_measurement: 'dB'
  - platform: mqtt
    name: garage_door_status
    state_topic: "garadget/APGarageDoor/status"
    value_template: ‘{{ value_json.status }}’ 

It works fine at telling me whether my Garage Door is closed or not. However the status outputs ‘closed’ in apostrophes or ‘open’ etc. Lots of my automations aren’t working and I’m wondering if this is the reason. Is there a way I can get it to stop putting the status within apostrophes?

I’ve tried removing the apostrophies from {{ value_json.time }} but then the YAML breaks.

You are using “fancy” single quotes: ‘ ’

You should be using these ones: ' '

You’re a genius. Didn’t think something so simple would be the problem. Damn copy paste!

Please read this, specifically points 3 and 11: How to help us help you - or How to ask a good question

I’d be glad to help if you follow the instructions mentioned.

There is no need to get cynical. @tom_l made a valid point. If you expect help follow a few simple rules and also post the code correctly formatted. It makes it easier to read.

1 Like