Hey folk,
I need your help for my problem as following:
I want to read and set a time register for my inverter via modbus but i do not how to translate the values for read/set for the input_datetime field.
The register (uint16) itsself is read-writeable and contains e,g, a value “773” [Dec] for 03:05 am which is also ‘0305’ (Hex). hh:mm.
ok, the “data option” from the sensor is ‘773’ but I need it as 03:05 for my field.
Later on I want to set the time to 05:15 which is 1295 [Dec] or '050F [Hex] but how to do the translation of the value.
Many thanks in advance for help.
Edit:
Value to change for reading “Dec->Hex>hh:mm”
and for writing “hh:mm->Hex->Dec”
Obviously create the gw25_my_47515_newtime sensor. The input_datetimetime only sensors return ‘HH:MM:SS’, so we catch it in the split, but we dont use the seconds var.
well, your script for the conversion runs super, thanks
But now my “Input_datetime sensor” did not refresh anyway and as you wrote, that i need another input-sensor esp. for hh:mm. but i have no idea how to do. May be you can help me again?