In MQTT communication, the Smart Appliance Enabler distinguishes between:
- Messages
- Events
The Smart Appliance Enabler sends the following MQTT messages either once (with the flag Retained
) or periodically.
An ApplianceInfoMessage
is sent once during initialization.
/sae/<appliance_id>/ApplianceInfoMessage
Example
/sae/F-12345678-000000000001-00/ApplianceInfoMessage
field | type | example value | description |
---|---|---|---|
applianceInfo | ApplianceInfo | see below | Information about the appliance |
times | String | 2022-12-27T19:11:25.952152 | Creation timestamp |
type | String | MeterMessage | Type of message |
The structure of ApplianceInfo
looks like this:
A ControlMessage
is sent each time the status of the switch is determined.
It is also used for switching.
/sae/<appliance_id>/Control
Example
/sae/F-12345678-000000000001-00/Control
/sae/<appliance_id>/Control/set
Example
/sae/F-12345678-000000000001-00/Control/set
field | type | example value | description |
---|---|---|---|
on | Boolean | true | switch(ed) on = true; switch(ed) off = false |
time | String | 2022-12-27T19:11:25.952152 | Creation timestamp |
type | String | MeterMessage | Type of message |
A MeterMessage
is sent whenever new values for 'Power' or 'Energy' are available.
/sae/<appliance_id>/Meter
Example
/sae/F-12345678-000000000001-00/Meter
field | type | example value | description |
---|---|---|---|
energy | Float | 2.56783 | Energy in kWh |
power | Integer | 131 | Power in W |
time | String | 2022-12-27T19:11:25.952152 | Creation timestamp |
type | String | MeterMessage | Type of message |
A StartingCurrentSwitchMessage
is an extended ControlMessage
and is sent whenever the status of a switch with starting current detection is determined.
/sae/<appliance_id>/Control
Example
/sae/F-12345678-000000000001-00/Control
In addition to the fields of the ControlMessage
, the following fields are included:
field | type | example value | description |
---|---|---|---|
powerThreshold | Integer | 15 | power threshold in W |
startingCurrentDetectionDuration | Integer | 30 | Duration of transgresion during switch on |
finishedCurrentDetectionDuration | Integer | 300 | Duration of undershoot durng switch off in s |
A SwitchOptionMessage
is an extended ControlMessage
and is sent whenever the status of a switch with a switch-on option is determined.
/sae/<appliance_id>/Control
Example
/sae/F-12345678-000000000001-00/Control
In addition to the fields of the ControlMessage
, the following fields are included:
field | type | example value | description |
---|---|---|---|
powerThreshold | Integer | 15 | power threshold in W |
switchOnDetectionDuration | Integer | 30 | Switch-on detection duration in s |
switchOffDetectionDuration | Integer | 300 | Switch-off detection duration in s |
A TimeframeIntervalQueueMessage
is only sent when the queue is filled or changed (with the flag Retained
).
/sae/<appliance_id>/TimeframeIntervalQueueMessage
Example
/sae/F-12345678-000000000001-00/TimeframeIntervalQueueMessage
field | type | example value | description |
---|---|---|---|
entries | TimeframeIntervalQueueEntry[] | see below | List of timeframes in the queue |
time | String | 2022-12-27T19:11:25.952152 | Creation timestamp |
type | String | MeterMessage | Type of message |
The structure of a TimeframeIntervalQueueEntry
looks like this:
field | type | example value | description |
---|---|---|---|
state | String | ACTIVE | Status of timeframe |
start | String | 2022-12-27T10:00:00 | Begin of timeframe |
end | String | 2022-12-27T18:00:00 | End of timeframe |
type | String | RuntimeRequest | Type of request |
min | Integer | null | min. Runtime/Energy |
max | Integer | 10800 | max. Runtime/Energy |
enabled | Boolean | true | Request enabled = true; Request disabled = false |
A VariablePowerConsumerMessage
is an extended ControlMessage
and is sent whenever the status of a switch for a device with variable power consumption is determined.
It is also used for switching.
/sae/<appliance_id>/Control
Example
/sae/F-12345678-000000000001-00/Control
/sae/<appliance_id>/Control/set
Example
/sae/F-12345678-000000000001-00/Control/set
In addition to the fields of the ControlMessage
, the following fields are included:
field | type | example value | description |
---|---|---|---|
power | Integer | 1200 | current/requested power consumption |
useOptionalEnergy | Boolean | false | Excess energy is used = true; Excess energy is not used = false |
Events are also MQTT messages, but contain the grouping level Event
after the appliance ID in the topic:
/sae/<appliance_id>/Event/...
The Smart Appliance Enabler only sends events when they occur.
By default, all events have the following payload
:
field | type | example value | description |
---|---|---|---|
time | String | 2022-12-27T19:11:25.952152 | Creation timestamp |
type | String | MqttMesage | Type of message |
When EnableRuntimeRequest
is received, the request of the first timeframe is set to enabled
.
However, requirements are enabled by default unless they are marked "external activation".
/sae/<appliance_id>/Event/EnableRuntimeRequest
Example
/sae/F-12345678-000000000001-00/Event/EnableRuntimeRequest
If DisableRuntimeRequest
is received, the request of the first timeframe will be set to disabled
.
/sae/<appliance_id>/Event/DisableRuntimeRequest
Example
/sae/F-12345678-000000000001-00/Event/DisableRuntimeRequest
If the SOC calculated or supplied by the SOC script changes, this event is sent.
/sae/<appliance_id>/Event/EVChargerSocChangedEvent
Example
/sae/F-12345678-000000000001-00/Event/EVChargerSocChangedEvent
In addition to the common fields of each event, the following fields are included:
field | type | example value | description |
---|---|---|---|
chargeLoss | Float | 11.123 | current charge loss in percent |
socValues | SocValues | see below | SOC at different times |
socInitialTime | String | 2022-12-27T19:11:25.952152 | Timestamp of the initial SOC |
socRetrievedTime | String | 2022-12-27T19:11:25.952152 | Timestamp of the SOC returned by SOC script |
The structure of SocValues
looks like this:
field | type | example value | description |
---|---|---|---|
batteryCapacity | Integer | 36000 | EV configuration: battery capacity |
current | Integer | 52 | current, calculated SOC |
initial | Integer | 19 | SOC when the EV was connected with charger |
retrieved | Integer | 40 | SOC returned during last execution of SOC script |
If the status of the wallbox changes, this event is sent.
/sae/<appliance_id>/Event/EVChargerStateChangedEvent
Example
/sae/F-12345678-000000000001-00/Event/EVChargerStateChangedEvent
In addition to the common fields of each event, the following fields are included:
field | type | example value | description |
---|---|---|---|
evId | Integer | 1 | ID of the EV connected |
newState | String | VEHICLE_CONNECTED | new Status |
previousState | String | VEHICLE_NOT_CONNECTED | previous Status |
This event is sent when the Sunny Home Manager fetches all data from the Smart Appliance Enabler.
/sae/<appliance_id>/Event/SempDevice2EM
Example
/sae/F-12345678-000000000001-00/Event/SempDevice2EM
This event is sent when the Sunny Home Manager sends a switching command to the Smart Appliance Enabler.
/sae/<appliance_id>/Event/SempEM2Device
Example
/sae/F-12345678-000000000001-00/Event/SempEM2Device
This event is sent when the Sunny Home Manager only fetches the device information from the Smart Appliance Enabler.
/sae/<appliance_id>/Event/SempGetDeviceInfo
Example
/sae/F-12345678-000000000001-00/Event/SempGetDeviceInfo
This event is sent when the Sunny Home Manager only fetches the device status from the Smart Appliance Enabler.
/sae/<appliance_id>/Event/SempGetDeviceStatus
Example
/sae/F-12345678-000000000001-00/Event/SempGetDeviceStatus
This event is sent when the real switching status of a device with starting current detection or switch-on option changes.
/sae/<appliance_id>/Event/WrappedControlSwitchOffDetected
Example
/sae/F-12345678-000000000001-00/Event/WrappedControlSwitchOffDetected
TBD: https://www.home-assistant.io/integrations/mqtt/#rest-api