I’d like to…
Extract the date from the beginning of the “Value” string and hopefully convert it from UTC to my timezone
&/or convert the “TimeStamp” from that number to my timezone date & time.
Extract the text following \tMessage:
Extract the text following \tUser Code:
Paste this into the Template Editor and experiment with it to understand how it extracts the desired information.
{% set value = state_attr('sensor.front_door_log', 'Value') %}
{% set items = value.split('\t') %}
{% set userid = items[2].split()[1].strip() %}
{% set message = items[1].split(':')[1].strip() %}
{% set dt = strptime(items[0].strip()~'+00:00', '%d/%m/%Y %H:%M:%S%z') %}
UserID is {{ userid }}
Message is {{ message }}
Date and time (local) is {{ dt.timestamp() | timestamp_local }}
Here’s a simulation I performed to test the template:
Now to figure our why the record data is wrong! The current record should be unlocked by user code.
It has to be an openzwave:device issue because the logging record worked correctly on this device in HomeSeer…
Glad to hear it. Please mark my post with the Solution tag for the benefit of other users. By doing so, it will automatically place a check-mark next to the topic’s title which signals that this topic has an accepted solution.