Hi All, I’m trying to create a template sensor to track the different between the last sentTS and receivedTS for my schlage lock. Problem is I’m stuck trying to figure out the template.
receivedTS displays “2018-04-24 08:56:00:662” if I do {{states.zwave.schlage_deadbolt.attributes.receivedTS}}
If I do {{as_timestamp(states.zwave.schlage_deadbolt.attributes.receivedTS)}} I get none
If I do {{strptime(states.zwave.schlage_deadbolt.attributes.receivedTS,’%Y-%m-%d %H:%M:%S:%f’)}} I get 2018-04-24 08:56:00:662 (I think it’s means it’s not parsing because .year returns nothing)
If I do {{as_timestamp(strptime(states.zwave.schlage_deadbolt.attributes.receivedTS,’%Y-%m-%d %H:%M:%S:%f’))}} I get none
If I do {{as_timestamp(strptime(“2018-04-24 08:56:00:662”,’%Y-%m-%d %H:%M:%S:%f’))}} I get 1524574560.662 (.year for this strptime returns 2018, so it’s clearly working)
Is there a way to force HA to read the state like a string? That seems to be the problem but I’m at a loss for how to fix it. Thanks for your help!