Skip to content

Commit

Permalink
add date+datetime mapping (closes #1120 and #1134)
Browse files Browse the repository at this point in the history
  • Loading branch information
john30 committed Oct 2, 2024
1 parent eebb2ef commit 6d0511a
Showing 1 changed file with 28 additions and 7 deletions.
35 changes: 28 additions & 7 deletions contrib/etc/ebusd/mqtt-hassio.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,11 @@ circuit_part = {
type_map-number = number
type_map-list = string
type_map-time = time
# HA integration: skip string/date/datetime types completely
type_map-date = date
type_map-datetime = datetime

# HA integration: skip string types completely
type_map-string =
type_map-date =
type_map-datetime =

# field type switch designator, see below.
# HA integration: this is used to set several variable values depending on the field type, message name, field name, and unit.
Expand Down Expand Up @@ -222,13 +223,23 @@ type_switch-time =
sensor,,,time = from,|to,|time2,|timer
sensor,,,time3 = time,

# HA integration: the mapping list for (potentially) writable string entities containing a date value by field type, name, message, and unit.
type_switch-w-date =
text,,,date =

type_switch-date =
sensor,,, =

# HA integration: the mapping list for (potentially) writable string entities containing a datetime value by field type, name, message, and unit.
type_switch-w-datetime =
text,,,datetime =

type_switch-datetime =
sensor,,, =

# HA integration: currently unused mapping lists for non-numeric/non-binary entities.
#type_switch-string =
# sensor,, =
#type_switch-date =
# sensor,,measurement =
#type_switch-datetime =
# sensor, =

# HA integration: optional variable with the entity device class for numbers
type_class_number ?= ,
Expand Down Expand Up @@ -299,6 +310,16 @@ type_part-texttime3 = ,
"command_topic":"%topic/set",
"pattern": "^[012][0-9]:[0-5][0-9]:[0-5][0-9]$"%state_class

# HA integration: %type_part variable for date %type_topic
type_part-textdate = ,
"command_topic":"%topic/set",
"pattern": "^[0-3][0-9].[01][0-9].20[0-3][0-9]$"%state_class

# HA integration: %type_part variable for datetime %type_topic
type_part-textdatetime = ,
"command_topic":"%topic/set",
"pattern": "^[0-3][0-9].[01][0-9].20[0-3][0-9] [012][0-9]:[0-5][0-9]$"%state_class

# optional format string for converting a fields value list into %field_values.
# "$value" and "$text" are being replaced by the corresponding part.
field_values-entry = "$text"
Expand Down

0 comments on commit 6d0511a

Please sign in to comment.