Documentation ¶
Index ¶
- Constants
- Variables
- func GetDiscoveryTopic(d Device) string
- func GetTopic(d Device, rawTopicString string) string
- func GetTopicPrefix(d Device) string
- func MakeMessageHandler(d Device) func(client mqtt.Client, msg mqtt.Message)
- type AlarmControlPanel
- func (d *AlarmControlPanel) AddMessageHandler()
- func (d *AlarmControlPanel) AnnounceAvailable()
- func (d *AlarmControlPanel) GetMQTTFields() (fields MQTTFields)
- func (d *AlarmControlPanel) GetRawId() string
- func (d *AlarmControlPanel) GetUniqueId() string
- func (d *AlarmControlPanel) Initialize()
- func (d *AlarmControlPanel) PopulateDevice()
- func (d *AlarmControlPanel) PopulateTopics()
- func (d *AlarmControlPanel) SetMQTTFields(fields MQTTFields)
- func (d *AlarmControlPanel) Subscribe()
- func (d *AlarmControlPanel) UnSubscribe()
- func (d *AlarmControlPanel) UpdateState()
- type BinarySensor
- func (d *BinarySensor) AddMessageHandler()
- func (d *BinarySensor) AnnounceAvailable()
- func (d *BinarySensor) GetMQTTFields() (fields MQTTFields)
- func (d *BinarySensor) GetRawId() string
- func (d *BinarySensor) GetUniqueId() string
- func (d *BinarySensor) Initialize()
- func (d *BinarySensor) PopulateDevice()
- func (d *BinarySensor) PopulateTopics()
- func (d *BinarySensor) SetMQTTFields(fields MQTTFields)
- func (d *BinarySensor) Subscribe()
- func (d *BinarySensor) UnSubscribe()
- func (d *BinarySensor) UpdateState()
- type Button
- func (d *Button) AddMessageHandler()
- func (d *Button) AnnounceAvailable()
- func (d *Button) GetMQTTFields() (fields MQTTFields)
- func (d *Button) GetRawId() string
- func (d *Button) GetUniqueId() string
- func (d *Button) Initialize()
- func (d *Button) PopulateDevice()
- func (d *Button) PopulateTopics()
- func (d *Button) SetMQTTFields(fields MQTTFields)
- func (d *Button) Subscribe()
- func (d *Button) UnSubscribe()
- func (d *Button) UpdateState()
- type Camera
- func (d *Camera) AddMessageHandler()
- func (d *Camera) AnnounceAvailable()
- func (d *Camera) GetMQTTFields() (fields MQTTFields)
- func (d *Camera) GetRawId() string
- func (d *Camera) GetUniqueId() string
- func (d *Camera) Initialize()
- func (d *Camera) PopulateDevice()
- func (d *Camera) PopulateTopics()
- func (d *Camera) SetMQTTFields(fields MQTTFields)
- func (d *Camera) Subscribe()
- func (d *Camera) UnSubscribe()
- func (d *Camera) UpdateState()
- type Climate
- func (d *Climate) AddMessageHandler()
- func (d *Climate) AnnounceAvailable()
- func (d *Climate) GetMQTTFields() (fields MQTTFields)
- func (d *Climate) GetRawId() string
- func (d *Climate) GetUniqueId() string
- func (d *Climate) Initialize()
- func (d *Climate) PopulateDevice()
- func (d *Climate) PopulateTopics()
- func (d *Climate) SetMQTTFields(fields MQTTFields)
- func (d *Climate) Subscribe()
- func (d *Climate) UnSubscribe()
- func (d *Climate) UpdateState()
- type Cover
- func (d *Cover) AddMessageHandler()
- func (d *Cover) AnnounceAvailable()
- func (d *Cover) GetMQTTFields() (fields MQTTFields)
- func (d *Cover) GetRawId() string
- func (d *Cover) GetUniqueId() string
- func (d *Cover) Initialize()
- func (d *Cover) PopulateDevice()
- func (d *Cover) PopulateTopics()
- func (d *Cover) SetMQTTFields(fields MQTTFields)
- func (d *Cover) Subscribe()
- func (d *Cover) UnSubscribe()
- func (d *Cover) UpdateState()
- type Device
- type DeviceTracker
- func (d *DeviceTracker) AddMessageHandler()
- func (d *DeviceTracker) AnnounceAvailable()
- func (d *DeviceTracker) GetMQTTFields() (fields MQTTFields)
- func (d *DeviceTracker) GetRawId() string
- func (d *DeviceTracker) GetUniqueId() string
- func (d *DeviceTracker) Initialize()
- func (d *DeviceTracker) PopulateDevice()
- func (d *DeviceTracker) PopulateTopics()
- func (d *DeviceTracker) SetMQTTFields(fields MQTTFields)
- func (d *DeviceTracker) Subscribe()
- func (d *DeviceTracker) UnSubscribe()
- func (d *DeviceTracker) UpdateState()
- type DeviceTrigger
- func (d *DeviceTrigger) AddMessageHandler()
- func (d *DeviceTrigger) AnnounceAvailable()
- func (d *DeviceTrigger) GetMQTTFields() (fields MQTTFields)
- func (d *DeviceTrigger) GetRawId() string
- func (d DeviceTrigger) GetUniqueId() string
- func (d *DeviceTrigger) Initialize()
- func (d *DeviceTrigger) PopulateDevice()
- func (d *DeviceTrigger) PopulateTopics()
- func (d *DeviceTrigger) SetMQTTFields(fields MQTTFields)
- func (d *DeviceTrigger) Subscribe()
- func (d *DeviceTrigger) UnSubscribe()
- func (d *DeviceTrigger) UpdateState()
- type Event
- func (d *Event) AddMessageHandler()
- func (d *Event) AnnounceAvailable()
- func (d *Event) GetMQTTFields() (fields MQTTFields)
- func (d *Event) GetRawId() string
- func (d *Event) GetUniqueId() string
- func (d *Event) Initialize()
- func (d *Event) PopulateDevice()
- func (d *Event) PopulateTopics()
- func (d *Event) SetMQTTFields(fields MQTTFields)
- func (d *Event) Subscribe()
- func (d *Event) UnSubscribe()
- func (d *Event) UpdateState()
- type Fan
- func (d *Fan) AddMessageHandler()
- func (d *Fan) AnnounceAvailable()
- func (d *Fan) GetMQTTFields() (fields MQTTFields)
- func (d *Fan) GetRawId() string
- func (d *Fan) GetUniqueId() string
- func (d *Fan) Initialize()
- func (d *Fan) PopulateDevice()
- func (d *Fan) PopulateTopics()
- func (d *Fan) SetMQTTFields(fields MQTTFields)
- func (d *Fan) Subscribe()
- func (d *Fan) UnSubscribe()
- func (d *Fan) UpdateState()
- type Humidifier
- func (d *Humidifier) AddMessageHandler()
- func (d *Humidifier) AnnounceAvailable()
- func (d *Humidifier) GetMQTTFields() (fields MQTTFields)
- func (d *Humidifier) GetRawId() string
- func (d *Humidifier) GetUniqueId() string
- func (d *Humidifier) Initialize()
- func (d *Humidifier) PopulateDevice()
- func (d *Humidifier) PopulateTopics()
- func (d *Humidifier) SetMQTTFields(fields MQTTFields)
- func (d *Humidifier) Subscribe()
- func (d *Humidifier) UnSubscribe()
- func (d *Humidifier) UpdateState()
- type Image
- func (d *Image) AddMessageHandler()
- func (d *Image) AnnounceAvailable()
- func (d *Image) GetMQTTFields() (fields MQTTFields)
- func (d *Image) GetRawId() string
- func (d *Image) GetUniqueId() string
- func (d *Image) Initialize()
- func (d *Image) PopulateDevice()
- func (d *Image) PopulateTopics()
- func (d *Image) SetMQTTFields(fields MQTTFields)
- func (d *Image) Subscribe()
- func (d *Image) UnSubscribe()
- func (d *Image) UpdateState()
- type LawnMower
- func (d *LawnMower) AddMessageHandler()
- func (d *LawnMower) AnnounceAvailable()
- func (d *LawnMower) GetMQTTFields() (fields MQTTFields)
- func (d *LawnMower) GetRawId() string
- func (d *LawnMower) GetUniqueId() string
- func (d *LawnMower) Initialize()
- func (d *LawnMower) PopulateDevice()
- func (d *LawnMower) PopulateTopics()
- func (d *LawnMower) SetMQTTFields(fields MQTTFields)
- func (d *LawnMower) Subscribe()
- func (d *LawnMower) UnSubscribe()
- func (d *LawnMower) UpdateState()
- type Light
- func (d *Light) AddMessageHandler()
- func (d *Light) AnnounceAvailable()
- func (d *Light) GetMQTTFields() (fields MQTTFields)
- func (d *Light) GetRawId() string
- func (d *Light) GetUniqueId() string
- func (d *Light) Initialize()
- func (d *Light) PopulateDevice()
- func (d *Light) PopulateTopics()
- func (d *Light) SetMQTTFields(fields MQTTFields)
- func (d *Light) Subscribe()
- func (d *Light) UnSubscribe()
- func (d *Light) UpdateState()
- type Lock
- func (d *Lock) AddMessageHandler()
- func (d *Lock) AnnounceAvailable()
- func (d *Lock) GetMQTTFields() (fields MQTTFields)
- func (d *Lock) GetRawId() string
- func (d *Lock) GetUniqueId() string
- func (d *Lock) Initialize()
- func (d *Lock) PopulateDevice()
- func (d *Lock) PopulateTopics()
- func (d *Lock) SetMQTTFields(fields MQTTFields)
- func (d *Lock) Subscribe()
- func (d *Lock) UnSubscribe()
- func (d *Lock) UpdateState()
- type MQTTFields
- type Number
- func (d *Number) AddMessageHandler()
- func (d *Number) AnnounceAvailable()
- func (d *Number) GetMQTTFields() (fields MQTTFields)
- func (d *Number) GetRawId() string
- func (d *Number) GetUniqueId() string
- func (d *Number) Initialize()
- func (d *Number) PopulateDevice()
- func (d *Number) PopulateTopics()
- func (d *Number) SetMQTTFields(fields MQTTFields)
- func (d *Number) Subscribe()
- func (d *Number) UnSubscribe()
- func (d *Number) UpdateState()
- type Scene
- func (d *Scene) AddMessageHandler()
- func (d *Scene) AnnounceAvailable()
- func (d *Scene) GetMQTTFields() (fields MQTTFields)
- func (d *Scene) GetRawId() string
- func (d *Scene) GetUniqueId() string
- func (d *Scene) Initialize()
- func (d *Scene) PopulateDevice()
- func (d *Scene) PopulateTopics()
- func (d *Scene) SetMQTTFields(fields MQTTFields)
- func (d *Scene) Subscribe()
- func (d *Scene) UnSubscribe()
- func (d *Scene) UpdateState()
- type Select
- func (d *Select) AddMessageHandler()
- func (d *Select) AnnounceAvailable()
- func (d *Select) GetMQTTFields() (fields MQTTFields)
- func (d *Select) GetRawId() string
- func (d *Select) GetUniqueId() string
- func (d *Select) Initialize()
- func (d *Select) PopulateDevice()
- func (d *Select) PopulateTopics()
- func (d *Select) SetMQTTFields(fields MQTTFields)
- func (d *Select) Subscribe()
- func (d *Select) UnSubscribe()
- func (d *Select) UpdateState()
- type Sensor
- func (d *Sensor) AddMessageHandler()
- func (d *Sensor) AnnounceAvailable()
- func (d *Sensor) GetMQTTFields() (fields MQTTFields)
- func (d *Sensor) GetRawId() string
- func (d *Sensor) GetUniqueId() string
- func (d *Sensor) Initialize()
- func (d *Sensor) PopulateDevice()
- func (d *Sensor) PopulateTopics()
- func (d *Sensor) SetMQTTFields(fields MQTTFields)
- func (d *Sensor) Subscribe()
- func (d *Sensor) UnSubscribe()
- func (d *Sensor) UpdateState()
- type Siren
- func (d *Siren) AddMessageHandler()
- func (d *Siren) AnnounceAvailable()
- func (d *Siren) GetMQTTFields() (fields MQTTFields)
- func (d *Siren) GetRawId() string
- func (d *Siren) GetUniqueId() string
- func (d *Siren) Initialize()
- func (d *Siren) PopulateDevice()
- func (d *Siren) PopulateTopics()
- func (d *Siren) SetMQTTFields(fields MQTTFields)
- func (d *Siren) Subscribe()
- func (d *Siren) UnSubscribe()
- func (d *Siren) UpdateState()
- type StateStore
- type Switch
- func (d *Switch) AddMessageHandler()
- func (d *Switch) AnnounceAvailable()
- func (d *Switch) GetMQTTFields() (fields MQTTFields)
- func (d *Switch) GetRawId() string
- func (d *Switch) GetUniqueId() string
- func (d *Switch) Initialize()
- func (d *Switch) PopulateDevice()
- func (d *Switch) PopulateTopics()
- func (d *Switch) SetMQTTFields(fields MQTTFields)
- func (d *Switch) Subscribe()
- func (d *Switch) UnSubscribe()
- func (d *Switch) UpdateState()
- type Tag
- func (d *Tag) AddMessageHandler()
- func (d *Tag) AnnounceAvailable()
- func (d *Tag) GetMQTTFields() (fields MQTTFields)
- func (d *Tag) GetRawId() string
- func (d Tag) GetUniqueId() string
- func (d *Tag) Initialize()
- func (d *Tag) PopulateDevice()
- func (d *Tag) PopulateTopics()
- func (d *Tag) SetMQTTFields(fields MQTTFields)
- func (d *Tag) Subscribe()
- func (d *Tag) UnSubscribe()
- func (d *Tag) UpdateState()
- type Text
- func (d *Text) AddMessageHandler()
- func (d *Text) AnnounceAvailable()
- func (d *Text) GetMQTTFields() (fields MQTTFields)
- func (d *Text) GetRawId() string
- func (d *Text) GetUniqueId() string
- func (d *Text) Initialize()
- func (d *Text) PopulateDevice()
- func (d *Text) PopulateTopics()
- func (d *Text) SetMQTTFields(fields MQTTFields)
- func (d *Text) Subscribe()
- func (d *Text) UnSubscribe()
- func (d *Text) UpdateState()
- type Update
- func (d *Update) AddMessageHandler()
- func (d *Update) AnnounceAvailable()
- func (d *Update) GetMQTTFields() (fields MQTTFields)
- func (d *Update) GetRawId() string
- func (d *Update) GetUniqueId() string
- func (d *Update) Initialize()
- func (d *Update) PopulateDevice()
- func (d *Update) PopulateTopics()
- func (d *Update) SetMQTTFields(fields MQTTFields)
- func (d *Update) Subscribe()
- func (d *Update) UnSubscribe()
- func (d *Update) UpdateState()
- type Vacuum
- func (d *Vacuum) AddMessageHandler()
- func (d *Vacuum) AnnounceAvailable()
- func (d *Vacuum) GetMQTTFields() (fields MQTTFields)
- func (d *Vacuum) GetRawId() string
- func (d *Vacuum) GetUniqueId() string
- func (d *Vacuum) Initialize()
- func (d *Vacuum) PopulateDevice()
- func (d *Vacuum) PopulateTopics()
- func (d *Vacuum) SetMQTTFields(fields MQTTFields)
- func (d *Vacuum) Subscribe()
- func (d *Vacuum) UnSubscribe()
- func (d *Vacuum) UpdateState()
- type Valve
- func (d *Valve) AddMessageHandler()
- func (d *Valve) AnnounceAvailable()
- func (d *Valve) GetMQTTFields() (fields MQTTFields)
- func (d *Valve) GetRawId() string
- func (d *Valve) GetUniqueId() string
- func (d *Valve) Initialize()
- func (d *Valve) PopulateDevice()
- func (d *Valve) PopulateTopics()
- func (d *Valve) SetMQTTFields(fields MQTTFields)
- func (d *Valve) Subscribe()
- func (d *Valve) UnSubscribe()
- func (d *Valve) UpdateState()
- type WaterHeater
- func (d *WaterHeater) AddMessageHandler()
- func (d *WaterHeater) AnnounceAvailable()
- func (d *WaterHeater) GetMQTTFields() (fields MQTTFields)
- func (d *WaterHeater) GetRawId() string
- func (d *WaterHeater) GetUniqueId() string
- func (d *WaterHeater) Initialize()
- func (d *WaterHeater) PopulateDevice()
- func (d *WaterHeater) PopulateTopics()
- func (d *WaterHeater) SetMQTTFields(fields MQTTFields)
- func (d *WaterHeater) Subscribe()
- func (d *WaterHeater) UnSubscribe()
- func (d *WaterHeater) UpdateState()
Constants ¶
const DiscoveryPrefix = "homeassistant"
DiscoveryPrefix is the prefix that HA uses to discover on. Does not usually need changing.
Variables ¶
var InstanceName = "Homeassistant MQTT IOT"
InstanceName is the instance name, helpful for identifying a given client
var Manufacturer = "William Floyd"
var NodeID = "ha-mqtt-iot"
NodeID is the Node ID, that is, what that node connects under.
var SWVersion = "0.6.1"
SWVersion is the software version. TODO - Move this elsewhere maybe?
var SoftwareName = "Homeassistant MQTT IOT"
Functions ¶
func GetDiscoveryTopic ¶
func GetTopicPrefix ¶
Types ¶
type AlarmControlPanel ¶
type AlarmControlPanel struct { AvailabilityMode *string `json:"availability_mode,omitempty"` // "When `availability` is configured, this controls the conditions needed to set the entity to `available`. Valid entries are `all`, `any`, and `latest`. If set to `all`, `payload_available` must be received on all configured availability topics before the entity is marked as online. If set to `any`, `payload_available` must be received on at least one configured availability topic before the entity is marked as online. If set to `latest`, the last `payload_available` or `payload_not_available` received on any configured availability topic controls the availability." AvailabilityTemplate *string `json:"availability_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract device's availability from the `availability_topic`. To determine the devices's availability result of this template will be compared to `payload_available` and `payload_not_available`." AvailabilityTopic *string `json:"availability_topic,omitempty"` // "The MQTT topic subscribed to receive availability (online/offline) updates. Must not be used together with `availability`." AvailabilityFunc func() string `json:"-"` // Function for availability Code *string `json:"code,omitempty"` // "If defined, specifies a code to enable or disable the alarm in the frontend. Note that the code is validated locally and blocks sending MQTT messages to the remote device. For remote code validation, the code can be configured to either of the special values `REMOTE_CODE` (numeric code) or `REMOTE_CODE_TEXT` (text code). In this case, local code validation is bypassed but the frontend will still show a numeric or text code dialog. Use `command_template` to send the code to the remote device. Example configurations for remote code validation [can be found here](#configurations-with-remote-code-validation)." CodeArmRequired *bool `json:"code_arm_required,omitempty"` // "If true the code is required to arm the alarm. If false the code is not validated." CodeDisarmRequired *bool `json:"code_disarm_required,omitempty"` // "If true the code is required to disarm the alarm. If false the code is not validated." CodeTriggerRequired *bool `json:"code_trigger_required,omitempty"` // "If true the code is required to trigger the alarm. If false the code is not validated." CommandTemplate *string `json:"command_template,omitempty"` // "The [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) used for the command payload. Available variables: `action` and `code`." CommandTopic *string `json:"command_topic,omitempty"` // "The MQTT topic to publish commands to change the alarm state." CommandFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for command Device struct { ConfigurationUrl *string `json:"configuration_url,omitempty"` // "A link to the webpage that can manage the configuration of this device. Can be either an `http://`, `https://` or an internal `homeassistant://` URL." Connections *string `json:"connections,omitempty"` // "A list of connections of the device to the outside world as a list of tuples `[connection_type, connection_identifier]`. For example the MAC address of a network interface: `\"connections\": [[\"mac\", \"02:5b:26:a8:dc:12\"]]`." Identifiers *string `json:"identifiers,omitempty"` // "A list of IDs that uniquely identify the device. For example a serial number." Manufacturer *string `json:"manufacturer,omitempty"` // "The manufacturer of the device." Model *string `json:"model,omitempty"` // "The model of the device." Name *string `json:"name,omitempty"` // "The name of the device." SuggestedArea *string `json:"suggested_area,omitempty"` // "Suggest an area if the device isn’t in one yet." SwVersion *string `json:"sw_version,omitempty"` // "The firmware version of the device." ViaDevice *string `json:"via_device,omitempty"` // "Identifier of a device that routes messages between this device and Home Assistant. Examples of such devices are hubs, or parent devices of a sub-device. This is used to show device topology in Home Assistant." } `json:"device,omitempty"` // Device configuration parameters EnabledByDefault *bool `json:"enabled_by_default,omitempty"` // "Flag which defines if the entity should be enabled when first added." Encoding *string `json:"encoding,omitempty"` // "The encoding of the payloads received and published messages. Set to `\"\"` to disable decoding of incoming payload." EntityCategory *string `json:"entity_category,omitempty"` // "The [category](https://developers.home-assistant.io/docs/core/entity#generic-properties) of the entity." Icon *string `json:"icon,omitempty"` // "[Icon](/docs/configuration/customizing-devices/#icon) for the entity." JsonAttributesTemplate *string `json:"json_attributes_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the JSON dictionary from messages received on the `json_attributes_topic`. Usage example can be found in [MQTT sensor](/integrations/sensor.mqtt/#json-attributes-template-configuration) documentation." JsonAttributesTopic *string `json:"json_attributes_topic,omitempty"` // "The MQTT topic subscribed to receive a JSON dictionary payload and then set as sensor attributes. Usage example can be found in [MQTT sensor](/integrations/sensor.mqtt/#json-attributes-topic-configuration) documentation." JsonAttributesFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for json attributes Name *string `json:"name,omitempty"` // "The name of the alarm. Can be set to `null` if only the device name is relevant." ObjectId *string `json:"object_id,omitempty"` // "Used instead of `name` for automatic generation of `entity_id`" PayloadArmAway *string `json:"payload_arm_away,omitempty"` // "The payload to set armed-away mode on your Alarm Panel." PayloadArmCustomBypass *string `json:"payload_arm_custom_bypass,omitempty"` // "The payload to set armed-custom-bypass mode on your Alarm Panel." PayloadArmHome *string `json:"payload_arm_home,omitempty"` // "The payload to set armed-home mode on your Alarm Panel." PayloadArmNight *string `json:"payload_arm_night,omitempty"` // "The payload to set armed-night mode on your Alarm Panel." PayloadArmVacation *string `json:"payload_arm_vacation,omitempty"` // "The payload to set armed-vacation mode on your Alarm Panel." PayloadAvailable *string `json:"payload_available,omitempty"` // "The payload that represents the available state." PayloadDisarm *string `json:"payload_disarm,omitempty"` // "The payload to disarm your Alarm Panel." PayloadNotAvailable *string `json:"payload_not_available,omitempty"` // "The payload that represents the unavailable state." PayloadTrigger *string `json:"payload_trigger,omitempty"` // "The payload to trigger the alarm on your Alarm Panel." Qos *int `json:"qos,omitempty"` // "The maximum QoS level to be used when receiving and publishing messages." Retain *bool `json:"retain,omitempty"` // "If the published message should have the retain flag on or not." StateTopic *string `json:"state_topic,omitempty"` // "The MQTT topic subscribed to receive state updates." StateFunc func() string `json:"-"` // Function for state SupportedFeatures *([]string) `json:"supported_features,omitempty"` // "A list of features that the alarm control panel supports. The available list options are `arm_home`, `arm_away`, `arm_night`, `arm_vacation`, `arm_custom_bypass`, and `trigger`." UniqueId *string `json:"unique_id,omitempty"` // "An ID that uniquely identifies this alarm panel. If two alarm panels have the same unique ID, Home Assistant will raise an exception." ValueTemplate *string `json:"value_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the value." MQTT *MQTTFields `json:"-"` // MQTT configuration parameters }
////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////
func (*AlarmControlPanel) AddMessageHandler ¶
func (d *AlarmControlPanel) AddMessageHandler()
func (*AlarmControlPanel) AnnounceAvailable ¶
func (d *AlarmControlPanel) AnnounceAvailable()
func (*AlarmControlPanel) GetMQTTFields ¶
func (d *AlarmControlPanel) GetMQTTFields() (fields MQTTFields)
func (*AlarmControlPanel) GetRawId ¶
func (d *AlarmControlPanel) GetRawId() string
func (*AlarmControlPanel) GetUniqueId ¶
func (d *AlarmControlPanel) GetUniqueId() string
func (*AlarmControlPanel) Initialize ¶
func (d *AlarmControlPanel) Initialize()
func (*AlarmControlPanel) PopulateDevice ¶
func (d *AlarmControlPanel) PopulateDevice()
func (*AlarmControlPanel) PopulateTopics ¶
func (d *AlarmControlPanel) PopulateTopics()
func (*AlarmControlPanel) SetMQTTFields ¶
func (d *AlarmControlPanel) SetMQTTFields(fields MQTTFields)
func (*AlarmControlPanel) Subscribe ¶
func (d *AlarmControlPanel) Subscribe()
func (*AlarmControlPanel) UnSubscribe ¶
func (d *AlarmControlPanel) UnSubscribe()
func (*AlarmControlPanel) UpdateState ¶
func (d *AlarmControlPanel) UpdateState()
type BinarySensor ¶
type BinarySensor struct { AvailabilityMode *string `json:"availability_mode,omitempty"` // "When `availability` is configured, this controls the conditions needed to set the entity to `available`. Valid entries are `all`, `any`, and `latest`. If set to `all`, `payload_available` must be received on all configured availability topics before the entity is marked as online. If set to `any`, `payload_available` must be received on at least one configured availability topic before the entity is marked as online. If set to `latest`, the last `payload_available` or `payload_not_available` received on any configured availability topic controls the availability." AvailabilityTemplate *string `json:"availability_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract device's availability from the `availability_topic`. To determine the devices's availability result of this template will be compared to `payload_available` and `payload_not_available`." AvailabilityTopic *string `json:"availability_topic,omitempty"` // "The MQTT topic subscribed to receive birth and LWT messages from the MQTT device. If `availability` is not defined, the binary sensor will always be considered `available` and its state will be `on`, `off` or `unknown`. If `availability` is defined, the binary sensor will be considered as `unavailable` by default and the sensor's initial state will be `unavailable`. Must not be used together with `availability`." AvailabilityFunc func() string `json:"-"` // Function for availability Device struct { ConfigurationUrl *string `json:"configuration_url,omitempty"` // "A link to the webpage that can manage the configuration of this device. Can be either an `http://`, `https://` or an internal `homeassistant://` URL." Connections *string `json:"connections,omitempty"` // "A list of connections of the device to the outside world as a list of tuples `[connection_type, connection_identifier]`. For example the MAC address of a network interface: `\"connections\": [[\"mac\", \"02:5b:26:a8:dc:12\"]]`." Identifiers *string `json:"identifiers,omitempty"` // "A list of IDs that uniquely identify the device. For example a serial number." Manufacturer *string `json:"manufacturer,omitempty"` // "The manufacturer of the device." Model *string `json:"model,omitempty"` // "The model of the device." Name *string `json:"name,omitempty"` // "The name of the device." SuggestedArea *string `json:"suggested_area,omitempty"` // "Suggest an area if the device isn’t in one yet." SwVersion *string `json:"sw_version,omitempty"` // "The firmware version of the device." ViaDevice *string `json:"via_device,omitempty"` // "Identifier of a device that routes messages between this device and Home Assistant. Examples of such devices are hubs, or parent devices of a sub-device. This is used to show device topology in Home Assistant." } `json:"device,omitempty"` // Device configuration parameters DeviceClass *string `json:"device_class,omitempty"` // "Sets the [class of the device](/integrations/binary_sensor/#device-class), changing the device state and icon that is displayed on the frontend. The `device_class` can be `null`." EnabledByDefault *bool `json:"enabled_by_default,omitempty"` // "Flag which defines if the entity should be enabled when first added." Encoding *string `json:"encoding,omitempty"` // "The encoding of the payloads received. Set to `\"\"` to disable decoding of incoming payload." EntityCategory *string `json:"entity_category,omitempty"` // "The [category](https://developers.home-assistant.io/docs/core/entity/#generic-properties) of the entity. When set, the entity category must be `diagnostic` for sensors." ExpireAfter *int `json:"expire_after,omitempty"` // "If set, it defines the number of seconds after the sensor's state expires, if it's not updated. After expiry, the sensor's state becomes `unavailable`. Default the sensors state never expires." ForceUpdate *bool `json:"force_update,omitempty"` // "Sends update events (which results in update of [state object](/docs/configuration/state_object/)'s `last_changed`) even if the sensor's state hasn't changed. Useful if you want to have meaningful value graphs in history or want to create an automation that triggers on *every* incoming state message (not only when the sensor's new state is different to the current one)." Icon *string `json:"icon,omitempty"` // "[Icon](/docs/configuration/customizing-devices/#icon) for the entity." JsonAttributesTemplate *string `json:"json_attributes_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the JSON dictionary from messages received on the `json_attributes_topic`. Usage example can be found in [MQTT sensor](/integrations/sensor.mqtt/#json-attributes-template-configuration) documentation." JsonAttributesTopic *string `json:"json_attributes_topic,omitempty"` // "The MQTT topic subscribed to receive a JSON dictionary payload and then set as sensor attributes. Usage example can be found in [MQTT sensor](/integrations/sensor.mqtt/#json-attributes-topic-configuration) documentation." JsonAttributesFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for json attributes Name *string `json:"name,omitempty"` // "The name of the binary sensor. Can be set to `null` if only the device name is relevant." ObjectId *string `json:"object_id,omitempty"` // "Used instead of `name` for automatic generation of `entity_id`" OffDelay *int `json:"off_delay,omitempty"` // "For sensors that only send `on` state updates (like PIRs), this variable sets a delay in seconds after which the sensor's state will be updated back to `off`." PayloadAvailable *string `json:"payload_available,omitempty"` // "The string that represents the `online` state." PayloadNotAvailable *string `json:"payload_not_available,omitempty"` // "The string that represents the `offline` state." PayloadOff *string `json:"payload_off,omitempty"` // "The string that represents the `off` state. It will be compared to the message in the `state_topic` (see `value_template` for details)" PayloadOn *string `json:"payload_on,omitempty"` // "The string that represents the `on` state. It will be compared to the message in the `state_topic` (see `value_template` for details)" Qos *int `json:"qos,omitempty"` // "The maximum QoS level to be used when receiving and publishing messages." StateTopic *string `json:"state_topic,omitempty"` // "The MQTT topic subscribed to receive sensor's state." StateFunc func() string `json:"-"` // Function for state UniqueId *string `json:"unique_id,omitempty"` // "An ID that uniquely identifies this sensor. If two sensors have the same unique ID, Home Assistant will raise an exception." ValueTemplate *string `json:"value_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) that returns a string to be compared to `payload_on`/`payload_off` or an empty string, in which case the MQTT message will be removed. Remove this option when `payload_on` and `payload_off` are sufficient to match your payloads (i.e no pre-processing of original message is required)." MQTT *MQTTFields `json:"-"` // MQTT configuration parameters }
////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////
func (*BinarySensor) AddMessageHandler ¶
func (d *BinarySensor) AddMessageHandler()
func (*BinarySensor) AnnounceAvailable ¶
func (d *BinarySensor) AnnounceAvailable()
func (*BinarySensor) GetMQTTFields ¶
func (d *BinarySensor) GetMQTTFields() (fields MQTTFields)
func (*BinarySensor) GetRawId ¶
func (d *BinarySensor) GetRawId() string
func (*BinarySensor) GetUniqueId ¶
func (d *BinarySensor) GetUniqueId() string
func (*BinarySensor) Initialize ¶
func (d *BinarySensor) Initialize()
func (*BinarySensor) PopulateDevice ¶
func (d *BinarySensor) PopulateDevice()
func (*BinarySensor) PopulateTopics ¶
func (d *BinarySensor) PopulateTopics()
func (*BinarySensor) SetMQTTFields ¶
func (d *BinarySensor) SetMQTTFields(fields MQTTFields)
func (*BinarySensor) Subscribe ¶
func (d *BinarySensor) Subscribe()
func (*BinarySensor) UnSubscribe ¶
func (d *BinarySensor) UnSubscribe()
func (*BinarySensor) UpdateState ¶
func (d *BinarySensor) UpdateState()
type Button ¶
type Button struct { AvailabilityMode *string `json:"availability_mode,omitempty"` // "When `availability` is configured, this controls the conditions needed to set the entity to `available`. Valid entries are `all`, `any`, and `latest`. If set to `all`, `payload_available` must be received on all configured availability topics before the entity is marked as online. If set to `any`, `payload_available` must be received on at least one configured availability topic before the entity is marked as online. If set to `latest`, the last `payload_available` or `payload_not_available` received on any configured availability topic controls the availability." AvailabilityTemplate *string `json:"availability_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract device's availability from the `availability_topic`. To determine the devices's availability result of this template will be compared to `payload_available` and `payload_not_available`." AvailabilityTopic *string `json:"availability_topic,omitempty"` // "The MQTT topic subscribed to receive availability (online/offline) updates. Must not be used together with `availability`." AvailabilityFunc func() string `json:"-"` // Function for availability CommandTemplate *string `json:"command_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to generate the payload to send to `command_topic`." CommandTopic *string `json:"command_topic,omitempty"` // "The MQTT topic to publish commands to trigger the button." CommandFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for command Device struct { ConfigurationUrl *string `json:"configuration_url,omitempty"` // "A link to the webpage that can manage the configuration of this device. Can be either an `http://`, `https://` or an internal `homeassistant://` URL." Connections *string `json:"connections,omitempty"` // "A list of connections of the device to the outside world as a list of tuples `[connection_type, connection_identifier]`. For example the MAC address of a network interface: `\"connections\": [[\"mac\", \"02:5b:26:a8:dc:12\"]]`." Identifiers *string `json:"identifiers,omitempty"` // "A list of IDs that uniquely identify the device. For example a serial number." Manufacturer *string `json:"manufacturer,omitempty"` // "The manufacturer of the device." Model *string `json:"model,omitempty"` // "The model of the device." Name *string `json:"name,omitempty"` // "The name of the device." SuggestedArea *string `json:"suggested_area,omitempty"` // "Suggest an area if the device isn’t in one yet." SwVersion *string `json:"sw_version,omitempty"` // "The firmware version of the device." ViaDevice *string `json:"via_device,omitempty"` // "Identifier of a device that routes messages between this device and Home Assistant. Examples of such devices are hubs, or parent devices of a sub-device. This is used to show device topology in Home Assistant." } `json:"device,omitempty"` // Device configuration parameters DeviceClass *string `json:"device_class,omitempty"` // "The [type/class](/integrations/button/#device-class) of the button to set the icon in the frontend. The `device_class` can be `null`." EnabledByDefault *bool `json:"enabled_by_default,omitempty"` // "Flag which defines if the entity should be enabled when first added." Encoding *string `json:"encoding,omitempty"` // "The encoding of the published messages." EntityCategory *string `json:"entity_category,omitempty"` // "The [category](https://developers.home-assistant.io/docs/core/entity#generic-properties) of the entity." Icon *string `json:"icon,omitempty"` // "[Icon](/docs/configuration/customizing-devices/#icon) for the entity." JsonAttributesTemplate *string `json:"json_attributes_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the JSON dictionary from messages received on the `json_attributes_topic`. Usage example can be found in [MQTT sensor](/integrations/sensor.mqtt/#json-attributes-template-configuration) documentation." JsonAttributesTopic *string `json:"json_attributes_topic,omitempty"` // "The MQTT topic subscribed to receive a JSON dictionary payload and then set as sensor attributes. Usage example can be found in [MQTT sensor](/integrations/sensor.mqtt/#json-attributes-topic-configuration) documentation." JsonAttributesFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for json attributes Name *string `json:"name,omitempty"` // "The name to use when displaying this button. Can be set to `null` if only the device name is relevant." ObjectId *string `json:"object_id,omitempty"` // "Used instead of `name` for automatic generation of `entity_id`" PayloadAvailable *string `json:"payload_available,omitempty"` // "The payload that represents the available state." PayloadNotAvailable *string `json:"payload_not_available,omitempty"` // "The payload that represents the unavailable state." PayloadPress *string `json:"payload_press,omitempty"` // "The payload To send to trigger the button." Qos *int `json:"qos,omitempty"` // "The maximum QoS level to be used when receiving and publishing messages." Retain *bool `json:"retain,omitempty"` // "If the published message should have the retain flag on or not." UniqueId *string `json:"unique_id,omitempty"` // "An ID that uniquely identifies this button entity. If two buttons have the same unique ID, Home Assistant will raise an exception." MQTT *MQTTFields `json:"-"` // MQTT configuration parameters }
////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////
func (*Button) AddMessageHandler ¶
func (d *Button) AddMessageHandler()
func (*Button) AnnounceAvailable ¶
func (d *Button) AnnounceAvailable()
func (*Button) GetMQTTFields ¶
func (d *Button) GetMQTTFields() (fields MQTTFields)
func (*Button) GetUniqueId ¶
func (*Button) Initialize ¶
func (d *Button) Initialize()
func (*Button) PopulateDevice ¶
func (d *Button) PopulateDevice()
func (*Button) PopulateTopics ¶
func (d *Button) PopulateTopics()
func (*Button) SetMQTTFields ¶
func (d *Button) SetMQTTFields(fields MQTTFields)
func (*Button) UnSubscribe ¶
func (d *Button) UnSubscribe()
func (*Button) UpdateState ¶
func (d *Button) UpdateState()
type Camera ¶
type Camera struct { AvailabilityMode *string `json:"availability_mode,omitempty"` // "When `availability` is configured, this controls the conditions needed to set the entity to `available`. Valid entries are `all`, `any`, and `latest`. If set to `all`, `payload_available` must be received on all configured availability topics before the entity is marked as online. If set to `any`, `payload_available` must be received on at least one configured availability topic before the entity is marked as online. If set to `latest`, the last `payload_available` or `payload_not_available` received on any configured availability topic controls the availability." AvailabilityTemplate *string `json:"availability_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract device's availability from the `availability_topic`. To determine the devices's availability result of this template will be compared to `payload_available` and `payload_not_available`." AvailabilityTopic *string `json:"availability_topic,omitempty"` // "The MQTT topic subscribed to receive availability (online/offline) updates. Must not be used together with `availability`." AvailabilityFunc func() string `json:"-"` // Function for availability Device struct { ConfigurationUrl *string `json:"configuration_url,omitempty"` // "A link to the webpage that can manage the configuration of this device. Can be either an `http://`, `https://` or an internal `homeassistant://` URL." Connections *string `json:"connections,omitempty"` // "A list of connections of the device to the outside world as a list of tuples `[connection_type, connection_identifier]`. For example the MAC address of a network interface: `\"connections\": [[\"mac\", \"02:5b:26:a8:dc:12\"]]`." Identifiers *string `json:"identifiers,omitempty"` // "A list of IDs that uniquely identify the device. For example a serial number." Manufacturer *string `json:"manufacturer,omitempty"` // "The manufacturer of the device." Model *string `json:"model,omitempty"` // "The model of the device." Name *string `json:"name,omitempty"` // "The name of the device." SuggestedArea *string `json:"suggested_area,omitempty"` // "Suggest an area if the device isn’t in one yet." SwVersion *string `json:"sw_version,omitempty"` // "The firmware version of the device." ViaDevice *string `json:"via_device,omitempty"` // "Identifier of a device that routes messages between this device and Home Assistant. Examples of such devices are hubs, or parent devices of a sub-device. This is used to show device topology in Home Assistant." } `json:"device,omitempty"` // Device configuration parameters EnabledByDefault *bool `json:"enabled_by_default,omitempty"` // "Flag which defines if the entity should be enabled when first added." Encoding *string `json:"encoding,omitempty"` // "The encoding of the payloads received. Set to `\"\"` to disable decoding of incoming payload. Use `image_encoding` to enable `Base64` decoding on `topic`." EntityCategory *string `json:"entity_category,omitempty"` // "The [category](https://developers.home-assistant.io/docs/core/entity#generic-properties) of the entity." Icon *string `json:"icon,omitempty"` // "[Icon](/docs/configuration/customizing-devices/#icon) for the entity." ImageEncoding *string `json:"image_encoding,omitempty"` // "The encoding of the image payloads received. Set to `\"b64\"` to enable base64 decoding of image payload. If not set, the image payload must be raw binary data." JsonAttributesTemplate *string `json:"json_attributes_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the JSON dictionary from messages received on the `json_attributes_topic`." JsonAttributesTopic *string `json:"json_attributes_topic,omitempty"` // "The MQTT topic subscribed to receive a JSON dictionary payload and then set as sensor attributes. Implies `force_update` of the current sensor state when a message is received on this topic." JsonAttributesFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for json attributes Name *string `json:"name,omitempty"` // "The name of the camera. Can be set to `null` if only the device name is relevant." ObjectId *string `json:"object_id,omitempty"` // "Used instead of `name` for automatic generation of `entity_id`" StateTopic *string `json:"topic,omitempty"` // "The MQTT topic to subscribe to." StateFunc func() string `json:"-"` // Function for state UniqueId *string `json:"unique_id,omitempty"` // "An ID that uniquely identifies this camera. If two cameras have the same unique ID Home Assistant will raise an exception." MQTT *MQTTFields `json:"-"` // MQTT configuration parameters }
////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////
func (*Camera) AddMessageHandler ¶
func (d *Camera) AddMessageHandler()
func (*Camera) AnnounceAvailable ¶
func (d *Camera) AnnounceAvailable()
func (*Camera) GetMQTTFields ¶
func (d *Camera) GetMQTTFields() (fields MQTTFields)
func (*Camera) GetUniqueId ¶
func (*Camera) Initialize ¶
func (d *Camera) Initialize()
func (*Camera) PopulateDevice ¶
func (d *Camera) PopulateDevice()
func (*Camera) PopulateTopics ¶
func (d *Camera) PopulateTopics()
func (*Camera) SetMQTTFields ¶
func (d *Camera) SetMQTTFields(fields MQTTFields)
func (*Camera) UnSubscribe ¶
func (d *Camera) UnSubscribe()
func (*Camera) UpdateState ¶
func (d *Camera) UpdateState()
type Climate ¶
type Climate struct { ActionTemplate *string `json:"action_template,omitempty"` // "A template to render the value received on the `action_topic` with." ActionTopic *string `json:"action_topic,omitempty"` // "The MQTT topic to subscribe for changes of the current action. If this is set, the climate graph uses the value received as data source. Valid values: `off`, `heating`, `cooling`, `drying`, `idle`, `fan`." ActionFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for action AvailabilityMode *string `json:"availability_mode,omitempty"` // "When `availability` is configured, this controls the conditions needed to set the entity to `available`. Valid entries are `all`, `any`, and `latest`. If set to `all`, `payload_available` must be received on all configured availability topics before the entity is marked as online. If set to `any`, `payload_available` must be received on at least one configured availability topic before the entity is marked as online. If set to `latest`, the last `payload_available` or `payload_not_available` received on any configured availability topic controls the availability." AvailabilityTemplate *string `json:"availability_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract device's availability from the `availability_topic`. To determine the devices's availability result of this template will be compared to `payload_available` and `payload_not_available`." AvailabilityTopic *string `json:"availability_topic,omitempty"` // "The MQTT topic subscribed to receive availability (online/offline) updates. Must not be used together with `availability`." AvailabilityFunc func() string `json:"-"` // Function for availability CurrentHumidityTemplate *string `json:"current_humidity_template,omitempty"` // "A template with which the value received on `current_humidity_topic` will be rendered." CurrentHumidityTopic *string `json:"current_humidity_topic,omitempty"` // "The MQTT topic on which to listen for the current humidity. A `\"None\"` value received will reset the current humidity. Empty values (`”'`) will be ignored." CurrentHumidityFunc func() string `json:"-"` // Function for current humidity CurrentTemperatureTemplate *string `json:"current_temperature_template,omitempty"` // "A template with which the value received on `current_temperature_topic` will be rendered." CurrentTemperatureTopic *string `json:"current_temperature_topic,omitempty"` // "The MQTT topic on which to listen for the current temperature. A `\"None\"` value received will reset the current temperature. Empty values (`”'`) will be ignored." CurrentTemperatureFunc func() string `json:"-"` // Function for current temperature Device struct { ConfigurationUrl *string `json:"configuration_url,omitempty"` // "A link to the webpage that can manage the configuration of this device. Can be either an `http://`, `https://` or an internal `homeassistant://` URL." Connections *string `json:"connections,omitempty"` // "A list of connections of the device to the outside world as a list of tuples `[connection_type, connection_identifier]`. For example the MAC address of a network interface: `\"connections\": [[\"mac\", \"02:5b:26:a8:dc:12\"]]`." Identifiers *string `json:"identifiers,omitempty"` // "A list of IDs that uniquely identify the device. For example a serial number." Manufacturer *string `json:"manufacturer,omitempty"` // "The manufacturer of the device." Model *string `json:"model,omitempty"` // "The model of the device." Name *string `json:"name,omitempty"` // "The name of the device." SuggestedArea *string `json:"suggested_area,omitempty"` // "Suggest an area if the device isn’t in one yet." SwVersion *string `json:"sw_version,omitempty"` // "The firmware version of the device." ViaDevice *string `json:"via_device,omitempty"` // "Identifier of a device that routes messages between this device and Home Assistant. Examples of such devices are hubs, or parent devices of a sub-device. This is used to show device topology in Home Assistant." } `json:"device,omitempty"` // Device configuration parameters EnabledByDefault *bool `json:"enabled_by_default,omitempty"` // "Flag which defines if the entity should be enabled when first added." Encoding *string `json:"encoding,omitempty"` // "The encoding of the payloads received and published messages. Set to `\"\"` to disable decoding of incoming payload." EntityCategory *string `json:"entity_category,omitempty"` // "The [category](https://developers.home-assistant.io/docs/core/entity#generic-properties) of the entity." FanModeCommandTemplate *string `json:"fan_mode_command_template,omitempty"` // "A template to render the value sent to the `fan_mode_command_topic` with." FanModeCommandTopic *string `json:"fan_mode_command_topic,omitempty"` // "The MQTT topic to publish commands to change the fan mode." FanModeCommandFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for fan mode command FanModeStateTemplate *string `json:"fan_mode_state_template,omitempty"` // "A template to render the value received on the `fan_mode_state_topic` with." FanModeStateTopic *string `json:"fan_mode_state_topic,omitempty"` // "The MQTT topic to subscribe for changes of the HVAC fan mode. If this is not set, the fan mode works in optimistic mode (see below)." FanModeStateFunc func() string `json:"-"` // Function for fan mode state FanModes *([]string) `json:"fan_modes,omitempty"` // "A list of supported fan modes." Icon *string `json:"icon,omitempty"` // "[Icon](/docs/configuration/customizing-devices/#icon) for the entity." Initial *float64 `json:"initial,omitempty"` // "Set the initial target temperature. The default value depends on the temperature unit and will be 21° or 69.8°F." JsonAttributesTemplate *string `json:"json_attributes_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the JSON dictionary from messages received on the `json_attributes_topic`. Usage example can be found in [MQTT sensor](/integrations/sensor.mqtt/#json-attributes-template-configuration) documentation." JsonAttributesTopic *string `json:"json_attributes_topic,omitempty"` // "The MQTT topic subscribed to receive a JSON dictionary payload and then set as sensor attributes. Usage example can be found in [MQTT sensor](/integrations/sensor.mqtt/#json-attributes-topic-configuration) documentation." JsonAttributesFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for json attributes MaxHumidity *int `json:"max_humidity,omitempty"` // "The minimum target humidity percentage that can be set." MaxTemp *float64 `json:"max_temp,omitempty"` // "Maximum set point available. The default value depends on the temperature unit, and will be 35°C or 95°F." MinHumidity *int `json:"min_humidity,omitempty"` // "The maximum target humidity percentage that can be set." MinTemp *float64 `json:"min_temp,omitempty"` // "Minimum set point available. The default value depends on the temperature unit, and will be 7°C or 44.6°F." ModeCommandTemplate *string `json:"mode_command_template,omitempty"` // "A template to render the value sent to the `mode_command_topic` with." ModeCommandTopic *string `json:"mode_command_topic,omitempty"` // "The MQTT topic to publish commands to change the HVAC operation mode." ModeCommandFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for mode command ModeStateTemplate *string `json:"mode_state_template,omitempty"` // "A template to render the value received on the `mode_state_topic` with." ModeStateTopic *string `json:"mode_state_topic,omitempty"` // "The MQTT topic to subscribe for changes of the HVAC operation mode. If this is not set, the operation mode works in optimistic mode (see below)." ModeStateFunc func() string `json:"-"` // Function for mode state Modes *([]string) `json:"modes,omitempty"` // "A list of supported modes. Needs to be a subset of the default values." Name *string `json:"name,omitempty"` // "The name of the HVAC. Can be set to `null` if only the device name is relevant." ObjectId *string `json:"object_id,omitempty"` // "Used instead of `name` for automatic generation of `entity_id`" Optimistic *bool `json:"optimistic,omitempty"` // "Flag that defines if the climate works in optimistic mode" PayloadAvailable *string `json:"payload_available,omitempty"` // "The payload that represents the available state." PayloadNotAvailable *string `json:"payload_not_available,omitempty"` // "The payload that represents the unavailable state." PayloadOff *string `json:"payload_off,omitempty"` // "The payload sent to turn off the device." PayloadOn *string `json:"payload_on,omitempty"` // "The payload sent to turn the device on." PowerCommandTemplate *string `json:"power_command_template,omitempty"` // "A template to render the value sent to the `power_command_topic` with. The `value` parameter is the payload set for `payload_on` or `payload_off`." PowerCommandTopic *string `json:"power_command_topic,omitempty"` // "The MQTT topic to publish commands to change the HVAC power state. Sends the payload configured with `payload_on` if the climate is turned on via the `climate.turn_on`, or the payload configured with `payload_off` if the climate is turned off via the `climate.turn_off` service. Note that `optimistic` mode is not supported through `climate.turn_on` and `climate.turn_off` services. When called, these services will send a power command to the device but will not optimistically update the state of the climate entity. The climate device should report its state back via `mode_state_topic`." PowerCommandFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for power command Precision *float64 `json:"precision,omitempty"` // "The desired precision for this device. Can be used to match your actual thermostat's precision. Supported values are `0.1`, `0.5` and `1.0`." PresetModeCommandTemplate *string `json:"preset_mode_command_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to generate the payload to send to `preset_mode_command_topic`." PresetModeCommandTopic *string `json:"preset_mode_command_topic,omitempty"` // "The MQTT topic to publish commands to change the preset mode." PresetModeCommandFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for preset mode command PresetModeStateTopic *string `json:"preset_mode_state_topic,omitempty"` // "The MQTT topic subscribed to receive climate speed based on presets. When preset 'none' is received or `None` the `preset_mode` will be reset." PresetModeStateFunc func() string `json:"-"` // Function for preset mode state PresetModeValueTemplate *string `json:"preset_mode_value_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the `preset_mode` value from the payload received on `preset_mode_state_topic`." PresetModes *([]string) `json:"preset_modes,omitempty"` // "List of preset modes this climate is supporting. Common examples include `eco`, `away`, `boost`, `comfort`, `home`, `sleep` and `activity`." Qos *int `json:"qos,omitempty"` // "The maximum QoS level to be used when receiving and publishing messages." Retain *bool `json:"retain,omitempty"` // "Defines if published messages should have the retain flag set." SwingModeCommandTemplate *string `json:"swing_mode_command_template,omitempty"` // "A template to render the value sent to the `swing_mode_command_topic` with." SwingModeCommandTopic *string `json:"swing_mode_command_topic,omitempty"` // "The MQTT topic to publish commands to change the swing mode." SwingModeCommandFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for swing mode command SwingModeStateTemplate *string `json:"swing_mode_state_template,omitempty"` // "A template to render the value received on the `swing_mode_state_topic` with." SwingModeStateTopic *string `json:"swing_mode_state_topic,omitempty"` // "The MQTT topic to subscribe for changes of the HVAC swing mode. If this is not set, the swing mode works in optimistic mode (see below)." SwingModeStateFunc func() string `json:"-"` // Function for swing mode state SwingModes *([]string) `json:"swing_modes,omitempty"` // "A list of supported swing modes." TargetHumidityCommandTemplate *string `json:"target_humidity_command_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to generate the payload to send to `target_humidity_command_topic`." TargetHumidityCommandTopic *string `json:"target_humidity_command_topic,omitempty"` // "The MQTT topic to publish commands to change the target humidity." TargetHumidityCommandFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for target humidity command TargetHumidityStateTemplate *string `json:"target_humidity_state_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract a value for the climate `target_humidity` state." TargetHumidityStateTopic *string `json:"target_humidity_state_topic,omitempty"` // "The MQTT topic subscribed to receive the target humidity. If this is not set, the target humidity works in optimistic mode (see below). A `\"None\"` value received will reset the target humidity. Empty values (`”'`) will be ignored." TargetHumidityStateFunc func() string `json:"-"` // Function for target humidity state TempStep *float64 `json:"temp_step,omitempty"` // "Step size for temperature set point." TemperatureCommandTemplate *string `json:"temperature_command_template,omitempty"` // "A template to render the value sent to the `temperature_command_topic` with." TemperatureCommandTopic *string `json:"temperature_command_topic,omitempty"` // "The MQTT topic to publish commands to change the target temperature." TemperatureCommandFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for temperature command TemperatureHighCommandTemplate *string `json:"temperature_high_command_template,omitempty"` // "A template to render the value sent to the `temperature_high_command_topic` with." TemperatureHighCommandTopic *string `json:"temperature_high_command_topic,omitempty"` // "The MQTT topic to publish commands to change the high target temperature." TemperatureHighCommandFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for temperature high command TemperatureHighStateTemplate *string `json:"temperature_high_state_template,omitempty"` // "A template to render the value received on the `temperature_high_state_topic` with. A `\"None\"` value received will reset the temperature high set point. Empty values (`”'`) will be ignored." TemperatureHighStateTopic *string `json:"temperature_high_state_topic,omitempty"` // "The MQTT topic to subscribe for changes in the target high temperature. If this is not set, the target high temperature works in optimistic mode (see below)." TemperatureHighStateFunc func() string `json:"-"` // Function for temperature high state TemperatureLowCommandTemplate *string `json:"temperature_low_command_template,omitempty"` // "A template to render the value sent to the `temperature_low_command_topic` with." TemperatureLowCommandTopic *string `json:"temperature_low_command_topic,omitempty"` // "The MQTT topic to publish commands to change the target low temperature." TemperatureLowCommandFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for temperature low command TemperatureLowStateTemplate *string `json:"temperature_low_state_template,omitempty"` // "A template to render the value received on the `temperature_low_state_topic` with. A `\"None\"` value received will reset the temperature low set point. Empty values (`”'`) will be ignored." TemperatureLowStateTopic *string `json:"temperature_low_state_topic,omitempty"` // "The MQTT topic to subscribe for changes in the target low temperature. If this is not set, the target low temperature works in optimistic mode (see below)." TemperatureLowStateFunc func() string `json:"-"` // Function for temperature low state TemperatureStateTemplate *string `json:"temperature_state_template,omitempty"` // "A template to render the value received on the `temperature_state_topic` with." TemperatureStateTopic *string `json:"temperature_state_topic,omitempty"` // "The MQTT topic to subscribe for changes in the target temperature. If this is not set, the target temperature works in optimistic mode (see below). A `\"None\"` value received will reset the temperature set point. Empty values (`”'`) will be ignored." TemperatureStateFunc func() string `json:"-"` // Function for temperature state TemperatureUnit *string `json:"temperature_unit,omitempty"` // "Defines the temperature unit of the device, `C` or `F`. If this is not set, the temperature unit is set to the system temperature unit." UniqueId *string `json:"unique_id,omitempty"` // "An ID that uniquely identifies this HVAC device. If two HVAC devices have the same unique ID, Home Assistant will raise an exception." ValueTemplate *string `json:"value_template,omitempty"` // "Default template to render the payloads on *all* `*_state_topic`s with." MQTT *MQTTFields `json:"-"` // MQTT configuration parameters }
////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////
func (*Climate) AddMessageHandler ¶
func (d *Climate) AddMessageHandler()
func (*Climate) AnnounceAvailable ¶
func (d *Climate) AnnounceAvailable()
func (*Climate) GetMQTTFields ¶
func (d *Climate) GetMQTTFields() (fields MQTTFields)
func (*Climate) GetUniqueId ¶
func (*Climate) Initialize ¶
func (d *Climate) Initialize()
func (*Climate) PopulateDevice ¶
func (d *Climate) PopulateDevice()
func (*Climate) PopulateTopics ¶
func (d *Climate) PopulateTopics()
func (*Climate) SetMQTTFields ¶
func (d *Climate) SetMQTTFields(fields MQTTFields)
func (*Climate) UnSubscribe ¶
func (d *Climate) UnSubscribe()
func (*Climate) UpdateState ¶
func (d *Climate) UpdateState()
type Cover ¶
type Cover struct { AvailabilityMode *string `json:"availability_mode,omitempty"` // "When `availability` is configured, this controls the conditions needed to set the entity to `available`. Valid entries are `all`, `any`, and `latest`. If set to `all`, `payload_available` must be received on all configured availability topics before the entity is marked as online. If set to `any`, `payload_available` must be received on at least one configured availability topic before the entity is marked as online. If set to `latest`, the last `payload_available` or `payload_not_available` received on any configured availability topic controls the availability." AvailabilityTemplate *string `json:"availability_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract device's availability from the `availability_topic`. To determine the devices's availability result of this template will be compared to `payload_available` and `payload_not_available`." AvailabilityTopic *string `json:"availability_topic,omitempty"` // "The MQTT topic subscribed to to receive birth and LWT messages from the MQTT cover device. If an `availability` topic is not defined, the cover availability state will always be `available`. If an `availability` topic is defined, the cover availability state will be `unavailable` by default. Must not be used together with `availability`." AvailabilityFunc func() string `json:"-"` // Function for availability CommandTopic *string `json:"command_topic,omitempty"` // "The MQTT topic to publish commands to control the cover." CommandFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for command Device struct { ConfigurationUrl *string `json:"configuration_url,omitempty"` // "A link to the webpage that can manage the configuration of this device. Can be either an `http://`, `https://` or an internal `homeassistant://` URL." Connections *string `json:"connections,omitempty"` // "A list of connections of the device to the outside world as a list of tuples `[connection_type, connection_identifier]`. For example the MAC address of a network interface: `\"connections\": [[\"mac\", \"02:5b:26:a8:dc:12\"]]`." Identifiers *string `json:"identifiers,omitempty"` // "A list of IDs that uniquely identify the device. For example a serial number." Manufacturer *string `json:"manufacturer,omitempty"` // "The manufacturer of the device." Model *string `json:"model,omitempty"` // "The model of the device." Name *string `json:"name,omitempty"` // "The name of the device." SuggestedArea *string `json:"suggested_area,omitempty"` // "Suggest an area if the device isn’t in one yet." SwVersion *string `json:"sw_version,omitempty"` // "The firmware version of the device." ViaDevice *string `json:"via_device,omitempty"` // "Identifier of a device that routes messages between this device and Home Assistant. Examples of such devices are hubs, or parent devices of a sub-device. This is used to show device topology in Home Assistant." } `json:"device,omitempty"` // Device configuration parameters DeviceClass *string `json:"device_class,omitempty"` // "Sets the [class of the device](/integrations/cover/), changing the device state and icon that is displayed on the frontend. The `device_class` can be `null`." EnabledByDefault *bool `json:"enabled_by_default,omitempty"` // "Flag which defines if the entity should be enabled when first added." Encoding *string `json:"encoding,omitempty"` // "The encoding of the payloads received and published messages. Set to `\"\"` to disable decoding of incoming payload." EntityCategory *string `json:"entity_category,omitempty"` // "The [category](https://developers.home-assistant.io/docs/core/entity#generic-properties) of the entity." Icon *string `json:"icon,omitempty"` // "[Icon](/docs/configuration/customizing-devices/#icon) for the entity." JsonAttributesTemplate *string `json:"json_attributes_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the JSON dictionary from messages received on the `json_attributes_topic`. Usage example can be found in [MQTT sensor](/integrations/sensor.mqtt/#json-attributes-template-configuration) documentation." JsonAttributesTopic *string `json:"json_attributes_topic,omitempty"` // "The MQTT topic subscribed to receive a JSON dictionary payload and then set as sensor attributes. Usage example can be found in [MQTT sensor](/integrations/sensor.mqtt/#json-attributes-topic-configuration) documentation." JsonAttributesFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for json attributes Name *string `json:"name,omitempty"` // "The name of the cover. Can be set to `null` if only the device name is relevant." ObjectId *string `json:"object_id,omitempty"` // "Used instead of `name` for automatic generation of `entity_id`" Optimistic *bool `json:"optimistic,omitempty"` // "Flag that defines if switch works in optimistic mode." PayloadAvailable *string `json:"payload_available,omitempty"` // "The payload that represents the online state." PayloadClose *string `json:"payload_close,omitempty"` // "The command payload that closes the cover." PayloadNotAvailable *string `json:"payload_not_available,omitempty"` // "The payload that represents the offline state." PayloadOpen *string `json:"payload_open,omitempty"` // "The command payload that opens the cover." PayloadStop *string `json:"payload_stop,omitempty"` // "The command payload that stops the cover." PositionClosed *int `json:"position_closed,omitempty"` // "Number which represents closed position." PositionOpen *int `json:"position_open,omitempty"` // "Number which represents open position." PositionTemplate *string `json:"position_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) that can be used to extract the payload for the `position_topic` topic. Within the template the following variables are available: `entity_id`, `position_open`; `position_closed`; `tilt_min`; `tilt_max`. The `entity_id` can be used to reference the entity's attributes with help of the [states](/docs/configuration/templating/#states) template function;" PositionTopic *string `json:"position_topic,omitempty"` // "The MQTT topic subscribed to receive cover position messages." PositionFunc func() string `json:"-"` // Function for position Qos *int `json:"qos,omitempty"` // "The maximum QoS level to be used when receiving and publishing messages." Retain *bool `json:"retain,omitempty"` // "Defines if published messages should have the retain flag set." SetPositionTemplate *string `json:"set_position_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to define the position to be sent to the `set_position_topic` topic. Incoming position value is available for use in the template `{% raw %}{{ position }}{% endraw %}`. Within the template the following variables are available: `entity_id`, `position`, the target position in percent; `position_open`; `position_closed`; `tilt_min`; `tilt_max`. The `entity_id` can be used to reference the entity's attributes with help of the [states](/docs/configuration/templating/#states) template function;" SetPositionTopic *string `json:"set_position_topic,omitempty"` // "The MQTT topic to publish position commands to. You need to set position_topic as well if you want to use position topic. Use template if position topic wants different values than within range `position_closed` - `position_open`. If template is not defined and `position_closed != 100` and `position_open != 0` then proper position value is calculated from percentage position." SetPositionFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for set position StateClosed *string `json:"state_closed,omitempty"` // "The payload that represents the closed state." StateClosing *string `json:"state_closing,omitempty"` // "The payload that represents the closing state." StateOpen *string `json:"state_open,omitempty"` // "The payload that represents the open state." StateOpening *string `json:"state_opening,omitempty"` // "The payload that represents the opening state." StateStopped *string `json:"state_stopped,omitempty"` // "The payload that represents the stopped state (for covers that do not report `open`/`closed` state)." StateTopic *string `json:"state_topic,omitempty"` // "The MQTT topic subscribed to receive cover state messages. State topic can only read (`open`, `opening`, `closed`, `closing` or `stopped`) state." StateFunc func() string `json:"-"` // Function for state TiltClosedValue *int `json:"tilt_closed_value,omitempty"` // "The value that will be sent on a `close_cover_tilt` command." TiltCommandTemplate *string `json:"tilt_command_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) that can be used to extract the payload for the `tilt_command_topic` topic. Within the template the following variables are available: `entity_id`, `tilt_position`, the target tilt position in percent; `position_open`; `position_closed`; `tilt_min`; `tilt_max`. The `entity_id` can be used to reference the entity's attributes with help of the [states](/docs/configuration/templating/#states) template function;" TiltCommandTopic *string `json:"tilt_command_topic,omitempty"` // "The MQTT topic to publish commands to control the cover tilt." TiltCommandFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for tilt command TiltMax *int `json:"tilt_max,omitempty"` // "The maximum tilt value." TiltMin *int `json:"tilt_min,omitempty"` // "The minimum tilt value." TiltOpenedValue *int `json:"tilt_opened_value,omitempty"` // "The value that will be sent on an `open_cover_tilt` command." TiltOptimistic *bool `json:"tilt_optimistic,omitempty"` // "Flag that determines if tilt works in optimistic mode." TiltStatusTemplate *string `json:"tilt_status_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) that can be used to extract the payload for the `tilt_status_topic` topic. Within the template the following variables are available: `entity_id`, `position_open`; `position_closed`; `tilt_min`; `tilt_max`. The `entity_id` can be used to reference the entity's attributes with help of the [states](/docs/configuration/templating/#states) template function;" TiltStatusTopic *string `json:"tilt_status_topic,omitempty"` // "The MQTT topic subscribed to receive tilt status update values." TiltStatusFunc func() string `json:"-"` // Function for tilt status UniqueId *string `json:"unique_id,omitempty"` // "An ID that uniquely identifies this cover. If two covers have the same unique ID, Home Assistant will raise an exception." ValueTemplate *string `json:"value_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) that can be used to extract the payload for the `state_topic` topic." MQTT *MQTTFields `json:"-"` // MQTT configuration parameters }
////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////
func (*Cover) AddMessageHandler ¶
func (d *Cover) AddMessageHandler()
func (*Cover) AnnounceAvailable ¶
func (d *Cover) AnnounceAvailable()
func (*Cover) GetMQTTFields ¶
func (d *Cover) GetMQTTFields() (fields MQTTFields)
func (*Cover) GetUniqueId ¶
func (*Cover) Initialize ¶
func (d *Cover) Initialize()
func (*Cover) PopulateDevice ¶
func (d *Cover) PopulateDevice()
func (*Cover) PopulateTopics ¶
func (d *Cover) PopulateTopics()
func (*Cover) SetMQTTFields ¶
func (d *Cover) SetMQTTFields(fields MQTTFields)
func (*Cover) UnSubscribe ¶
func (d *Cover) UnSubscribe()
func (*Cover) UpdateState ¶
func (d *Cover) UpdateState()
type Device ¶
type Device interface { GetRawId() string GetUniqueId() string PopulateDevice() PopulateTopics() UpdateState() Subscribe() UnSubscribe() AddMessageHandler() SetMQTTFields(MQTTFields) GetMQTTFields() MQTTFields }
////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////
type DeviceTracker ¶
type DeviceTracker struct { AvailabilityMode *string `json:"availability_mode,omitempty"` // "When `availability` is configured, this controls the conditions needed to set the entity to `available`. Valid entries are `all`, `any`, and `latest`. If set to `all`, `payload_available` must be received on all configured availability topics before the entity is marked as online. If set to `any`, `payload_available` must be received on at least one configured availability topic before the entity is marked as online. If set to `latest`, the last `payload_available` or `payload_not_available` received on any configured availability topic controls the availability." AvailabilityTemplate *string `json:"availability_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract device's availability from the `availability_topic`. To determine the devices's availability result of this template will be compared to `payload_available` and `payload_not_available`." AvailabilityTopic *string `json:"availability_topic,omitempty"` // "The MQTT topic subscribed to receive availability (online/offline) updates. Must not be used together with `availability`." AvailabilityFunc func() string `json:"-"` // Function for availability Device struct { ConfigurationUrl *string `json:"configuration_url,omitempty"` // "A link to the webpage that can manage the configuration of this device. Can be either an `http://`, `https://` or an internal `homeassistant://` URL." Connections *string `json:"connections,omitempty"` // "A list of connections of the device to the outside world as a list of tuples `[connection_type, connection_identifier]`. For example the MAC address of a network interface: `\"connections\": [[\"mac\", \"02:5b:26:a8:dc:12\"]]`." Identifiers *string `json:"identifiers,omitempty"` // "A list of IDs that uniquely identify the device. For example a serial number." Manufacturer *string `json:"manufacturer,omitempty"` // "The manufacturer of the device." Model *string `json:"model,omitempty"` // "The model of the device." Name *string `json:"name,omitempty"` // "The name of the device." SuggestedArea *string `json:"suggested_area,omitempty"` // "Suggest an area if the device isn’t in one yet." SwVersion *string `json:"sw_version,omitempty"` // "The firmware version of the device." ViaDevice *string `json:"via_device,omitempty"` // "Identifier of a device that routes messages between this device and Home Assistant. Examples of such devices are hubs, or parent devices of a sub-device. This is used to show device topology in Home Assistant." } `json:"device,omitempty"` // Device configuration parameters Icon *string `json:"icon,omitempty"` // "[Icon](/docs/configuration/customizing-devices/#icon) for the entity." JsonAttributesTemplate *string `json:"json_attributes_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the JSON dictionary from messages received on the `json_attributes_topic`. Usage example can be found in [MQTT sensor](/integrations/sensor.mqtt/#json-attributes-template-configuration) documentation." JsonAttributesTopic *string `json:"json_attributes_topic,omitempty"` // "The MQTT topic subscribed to receive a JSON dictionary message containing device tracker attributes. This topic can be used to set the location of the device tracker under the following conditions:\n- If the attributes in the JSON message include `longitude`, `latitude`, and `gps_accuracy` (optional).\n - If the device tracker is within a configured [zone](/integrations/zone/).\n\nIf these conditions are met, it is not required to configure `state_topic`.\n\n Be aware that any location message received at `state_topic` overrides the location received via `json_attributes_topic` until a message configured with `payload_reset` is received at `state_topic`. For a more generic usage example of the `json_attributes_topic`, refer to the [MQTT sensor](/integrations/sensor.mqtt/#json-attributes-topic-configuration) documentation." JsonAttributesFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for json attributes Name *string `json:"name,omitempty"` // "The name of the MQTT device_tracker." ObjectId *string `json:"object_id,omitempty"` // "Used instead of `name` for automatic generation of `entity_id`" PayloadAvailable *string `json:"payload_available,omitempty"` // "The payload that represents the available state." PayloadHome *string `json:"payload_home,omitempty"` // "The payload value that represents the 'home' state for the device." PayloadNotAvailable *string `json:"payload_not_available,omitempty"` // "The payload that represents the unavailable state." PayloadNotHome *string `json:"payload_not_home,omitempty"` // "The payload value that represents the 'not_home' state for the device." PayloadReset *string `json:"payload_reset,omitempty"` // "The payload value that will have the device's location automatically derived from Home Assistant's zones." Qos *int `json:"qos,omitempty"` // "The maximum QoS level to be used when receiving and publishing messages." SourceType *string `json:"source_type,omitempty"` // "Attribute of a device tracker that affects state when being used to track a [person](/integrations/person/). Valid options are `gps`, `router`, `bluetooth`, or `bluetooth_le`." StateTopic *string `json:"state_topic,omitempty"` // "The MQTT topic subscribed to receive device tracker state changes. The states defined in `state_topic` override the location states defined by the `json_attributes_topic`. This state override is turned inactive if the `state_topic` receives a message containing `payload_reset`. The `state_topic` can only be omitted if `json_attributes_topic` is used." StateFunc func() string `json:"-"` // Function for state UniqueId *string `json:"unique_id,omitempty"` // "An ID that uniquely identifies this device_tracker. If two device_trackers have the same unique ID, Home Assistant will raise an exception." ValueTemplate *string `json:"value_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) that returns a device tracker state." MQTT *MQTTFields `json:"-"` // MQTT configuration parameters }
////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////
func (*DeviceTracker) AddMessageHandler ¶
func (d *DeviceTracker) AddMessageHandler()
func (*DeviceTracker) AnnounceAvailable ¶
func (d *DeviceTracker) AnnounceAvailable()
func (*DeviceTracker) GetMQTTFields ¶
func (d *DeviceTracker) GetMQTTFields() (fields MQTTFields)
func (*DeviceTracker) GetRawId ¶
func (d *DeviceTracker) GetRawId() string
func (*DeviceTracker) GetUniqueId ¶
func (d *DeviceTracker) GetUniqueId() string
func (*DeviceTracker) Initialize ¶
func (d *DeviceTracker) Initialize()
func (*DeviceTracker) PopulateDevice ¶
func (d *DeviceTracker) PopulateDevice()
func (*DeviceTracker) PopulateTopics ¶
func (d *DeviceTracker) PopulateTopics()
func (*DeviceTracker) SetMQTTFields ¶
func (d *DeviceTracker) SetMQTTFields(fields MQTTFields)
func (*DeviceTracker) Subscribe ¶
func (d *DeviceTracker) Subscribe()
func (*DeviceTracker) UnSubscribe ¶
func (d *DeviceTracker) UnSubscribe()
func (*DeviceTracker) UpdateState ¶
func (d *DeviceTracker) UpdateState()
type DeviceTrigger ¶
type DeviceTrigger struct { AutomationType *string `json:"automation_type,omitempty"` // "The type of automation, must be 'trigger'." Device struct { ConfigurationUrl *string `json:"configuration_url,omitempty"` // "A link to the webpage that can manage the configuration of this device. Can be either an `http://`, `https://` or an internal `homeassistant://` URL." Connections *string `json:"connections,omitempty"` // "A list of connections of the device to the outside world as a list of tuples `[connection_type, connection_identifier]`. For example the MAC address of a network interface: `\"connections\": [[\"mac\", \"02:5b:26:a8:dc:12\"]]`." Identifiers *string `json:"identifiers,omitempty"` // "A list of IDs that uniquely identify the device. For example a serial number." Manufacturer *string `json:"manufacturer,omitempty"` // "The manufacturer of the device." Model *string `json:"model,omitempty"` // "The model of the device." Name *string `json:"name,omitempty"` // "The name of the device." SuggestedArea *string `json:"suggested_area,omitempty"` // "Suggest an area if the device isn’t in one yet." SwVersion *string `json:"sw_version,omitempty"` // "The firmware version of the device." ViaDevice *string `json:"via_device,omitempty"` // "Identifier of a device that routes messages between this device and Home Assistant. Examples of such devices are hubs, or parent devices of a sub-device. This is used to show device topology in Home Assistant." } `json:"device,omitempty"` // Device configuration parameters Payload *string `json:"payload,omitempty"` // "Optional payload to match the payload being sent over the topic." Qos *int `json:"qos,omitempty"` // "The maximum QoS level to be used when receiving and publishing messages." Subtype *string `json:"subtype,omitempty"` // "The subtype of the trigger, e.g. `button_1`. Entries supported by the frontend: `turn_on`, `turn_off`, `button_1`, `button_2`, `button_3`, `button_4`, `button_5`, `button_6`. If set to an unsupported value, will render as `subtype type`, e.g. `left_button pressed` with `type` set to `button_short_press` and `subtype` set to `left_button`" StateTopic *string `json:"topic,omitempty"` // "The MQTT topic subscribed to receive trigger events." StateFunc func() string `json:"-"` // Function for state Type *string `json:"type,omitempty"` // "The type of the trigger, e.g. `button_short_press`. Entries supported by the frontend: `button_short_press`, `button_short_release`, `button_long_press`, `button_long_release`, `button_double_press`, `button_triple_press`, `button_quadruple_press`, `button_quintuple_press`. If set to an unsupported value, will render as `subtype type`, e.g. `button_1 spammed` with `type` set to `spammed` and `subtype` set to `button_1`" ValueTemplate *string `json:"value_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the value." MQTT *MQTTFields `json:"-"` // MQTT configuration parameters }
////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////
func (*DeviceTrigger) AddMessageHandler ¶
func (d *DeviceTrigger) AddMessageHandler()
func (*DeviceTrigger) AnnounceAvailable ¶
func (d *DeviceTrigger) AnnounceAvailable()
func (*DeviceTrigger) GetMQTTFields ¶
func (d *DeviceTrigger) GetMQTTFields() (fields MQTTFields)
func (*DeviceTrigger) GetRawId ¶
func (d *DeviceTrigger) GetRawId() string
func (DeviceTrigger) GetUniqueId ¶
func (d DeviceTrigger) GetUniqueId() string
func (*DeviceTrigger) Initialize ¶
func (d *DeviceTrigger) Initialize()
func (*DeviceTrigger) PopulateDevice ¶
func (d *DeviceTrigger) PopulateDevice()
func (*DeviceTrigger) PopulateTopics ¶
func (d *DeviceTrigger) PopulateTopics()
func (*DeviceTrigger) SetMQTTFields ¶
func (d *DeviceTrigger) SetMQTTFields(fields MQTTFields)
func (*DeviceTrigger) Subscribe ¶
func (d *DeviceTrigger) Subscribe()
func (*DeviceTrigger) UnSubscribe ¶
func (d *DeviceTrigger) UnSubscribe()
func (*DeviceTrigger) UpdateState ¶
func (d *DeviceTrigger) UpdateState()
type Event ¶
type Event struct { AvailabilityMode *string `json:"availability_mode,omitempty"` // "When `availability` is configured, this controls the conditions needed to set the entity to `available`. Valid entries are `all`, `any`, and `latest`. If set to `all`, `payload_available` must be received on all configured availability topics before the entity is marked as online. If set to `any`, `payload_available` must be received on at least one configured availability topic before the entity is marked as online. If set to `latest`, the last `payload_available` or `payload_not_available` received on any configured availability topic controls the availability." AvailabilityTemplate *string `json:"availability_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract device's availability from the `availability_topic`. To determine the devices's availability result of this template will be compared to `payload_available` and `payload_not_available`." AvailabilityTopic *string `json:"availability_topic,omitempty"` // "The MQTT topic subscribed to receive availability (online/offline) updates. Must not be used together with `availability`." AvailabilityFunc func() string `json:"-"` // Function for availability Device struct { ConfigurationUrl *string `json:"configuration_url,omitempty"` // "A link to the webpage that can manage the configuration of this device. Can be either an HTTP or HTTPS link." Connections *string `json:"connections,omitempty"` // "A list of connections of the device to the outside world as a list of tuples `[connection_type, connection_identifier]`. For example the MAC address of a network interface: `\"connections\": [[\"mac\", \"02:5b:26:a8:dc:12\"]]`." Identifiers *string `json:"identifiers,omitempty"` // "A list of IDs that uniquely identify the device. For example a serial number." Manufacturer *string `json:"manufacturer,omitempty"` // "The manufacturer of the device." Model *string `json:"model,omitempty"` // "The model of the device." Name *string `json:"name,omitempty"` // "The name of the device." SuggestedArea *string `json:"suggested_area,omitempty"` // "Suggest an area if the device isn’t in one yet." SwVersion *string `json:"sw_version,omitempty"` // "The firmware version of the device." ViaDevice *string `json:"via_device,omitempty"` // "Identifier of a device that routes messages between this device and Home Assistant. Examples of such devices are hubs, or parent devices of a sub-device. This is used to show device topology in Home Assistant." } `json:"device,omitempty"` // Device configuration parameters DeviceClass *string `json:"device_class,omitempty"` // "The [type/class](/integrations/event/#device-class) of the event to set the icon in the frontend. The `device_class` can be `null`." EnabledByDefault *bool `json:"enabled_by_default,omitempty"` // "Flag which defines if the entity should be enabled when first added." Encoding *string `json:"encoding,omitempty"` // "The encoding of the published messages." EntityCategory *string `json:"entity_category,omitempty"` // "The [category](https://developers.home-assistant.io/docs/core/entity#generic-properties) of the entity." EventTypes *([]string) `json:"event_types,omitempty"` // "A list of valid `event_type` strings." Icon *string `json:"icon,omitempty"` // "[Icon](/docs/configuration/customizing-devices/#icon) for the entity." JsonAttributesTemplate *string `json:"json_attributes_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the JSON dictionary from messages received on the `json_attributes_topic`. Usage example can be found in [MQTT sensor](/integrations/sensor.mqtt/#json-attributes-template-configuration) documentation." JsonAttributesTopic *string `json:"json_attributes_topic,omitempty"` // "The MQTT topic subscribed to receive a JSON dictionary payload and then set as sensor attributes. Usage example can be found in [MQTT sensor](/integrations/sensor.mqtt/#json-attributes-topic-configuration) documentation." JsonAttributesFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for json attributes Name *string `json:"name,omitempty"` // "The name to use when displaying this event." ObjectId *string `json:"object_id,omitempty"` // "Used instead of `name` for automatic generation of `entity_id`" PayloadAvailable *string `json:"payload_available,omitempty"` // "The payload that represents the available state." PayloadNotAvailable *string `json:"payload_not_available,omitempty"` // "The payload that represents the unavailable state." Qos *int `json:"qos,omitempty"` // "The maximum QoS level to be used when receiving and publishing messages." StateTopic *string `json:"state_topic,omitempty"` // "The MQTT topic subscribed to receive JSON event payloads. The JSON payload should contain the `event_type` element. The event type should be one of the configured `event_types`. Note that replayed retained messages will be discarded." StateFunc func() string `json:"-"` // Function for state UniqueId *string `json:"unique_id,omitempty"` // "An ID that uniquely identifies this event entity. If two events have the same unique ID, Home Assistant will raise an exception." ValueTemplate *string `json:"value_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the value and render it to a valid JSON event payload. If the template throws an error, the current state will be used instead." MQTT *MQTTFields `json:"-"` // MQTT configuration parameters }
////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////
func (*Event) AddMessageHandler ¶
func (d *Event) AddMessageHandler()
func (*Event) AnnounceAvailable ¶
func (d *Event) AnnounceAvailable()
func (*Event) GetMQTTFields ¶
func (d *Event) GetMQTTFields() (fields MQTTFields)
func (*Event) GetUniqueId ¶
func (*Event) Initialize ¶
func (d *Event) Initialize()
func (*Event) PopulateDevice ¶
func (d *Event) PopulateDevice()
func (*Event) PopulateTopics ¶
func (d *Event) PopulateTopics()
func (*Event) SetMQTTFields ¶
func (d *Event) SetMQTTFields(fields MQTTFields)
func (*Event) UnSubscribe ¶
func (d *Event) UnSubscribe()
func (*Event) UpdateState ¶
func (d *Event) UpdateState()
type Fan ¶
type Fan struct { AvailabilityMode *string `json:"availability_mode,omitempty"` // "When `availability` is configured, this controls the conditions needed to set the entity to `available`. Valid entries are `all`, `any`, and `latest`. If set to `all`, `payload_available` must be received on all configured availability topics before the entity is marked as online. If set to `any`, `payload_available` must be received on at least one configured availability topic before the entity is marked as online. If set to `latest`, the last `payload_available` or `payload_not_available` received on any configured availability topic controls the availability." AvailabilityTemplate *string `json:"availability_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract device's availability from the `availability_topic`. To determine the devices's availability result of this template will be compared to `payload_available` and `payload_not_available`." AvailabilityTopic *string `json:"availability_topic,omitempty"` // "The MQTT topic subscribed to receive availability (online/offline) updates. Must not be used together with `availability`." AvailabilityFunc func() string `json:"-"` // Function for availability CommandTemplate *string `json:"command_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to generate the payload to send to `command_topic`." CommandTopic *string `json:"command_topic,omitempty"` // "The MQTT topic to publish commands to change the fan state." CommandFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for command Device struct { ConfigurationUrl *string `json:"configuration_url,omitempty"` // "A link to the webpage that can manage the configuration of this device. Can be either an `http://`, `https://` or an internal `homeassistant://` URL." Connections *string `json:"connections,omitempty"` // "A list of connections of the device to the outside world as a list of tuples `[connection_type, connection_identifier]`. For example the MAC address of a network interface: `\"connections\": [[\"mac\", \"02:5b:26:a8:dc:12\"]]`." Identifiers *string `json:"identifiers,omitempty"` // "A list of IDs that uniquely identify the device. For example a serial number." Manufacturer *string `json:"manufacturer,omitempty"` // "The manufacturer of the device." Model *string `json:"model,omitempty"` // "The model of the device." Name *string `json:"name,omitempty"` // "The name of the device." SuggestedArea *string `json:"suggested_area,omitempty"` // "Suggest an area if the device isn’t in one yet." SwVersion *string `json:"sw_version,omitempty"` // "The firmware version of the device." ViaDevice *string `json:"via_device,omitempty"` // "Identifier of a device that routes messages between this device and Home Assistant. Examples of such devices are hubs, or parent devices of a sub-device. This is used to show device topology in Home Assistant." } `json:"device,omitempty"` // Device configuration parameters DirectionCommandTemplate *string `json:"direction_command_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to generate the payload to send to `direction_command_topic`." DirectionCommandTopic *string `json:"direction_command_topic,omitempty"` // "The MQTT topic to publish commands to change the direction state." DirectionCommandFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for direction command DirectionStateTopic *string `json:"direction_state_topic,omitempty"` // "The MQTT topic subscribed to receive direction state updates." DirectionStateFunc func() string `json:"-"` // Function for direction state DirectionValueTemplate *string `json:"direction_value_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract a value from the direction." EnabledByDefault *bool `json:"enabled_by_default,omitempty"` // "Flag which defines if the entity should be enabled when first added." Encoding *string `json:"encoding,omitempty"` // "The encoding of the payloads received and published messages. Set to `\"\"` to disable decoding of incoming payload." EntityCategory *string `json:"entity_category,omitempty"` // "The [category](https://developers.home-assistant.io/docs/core/entity#generic-properties) of the entity." Icon *string `json:"icon,omitempty"` // "[Icon](/docs/configuration/customizing-devices/#icon) for the entity." JsonAttributesTemplate *string `json:"json_attributes_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the JSON dictionary from messages received on the `json_attributes_topic`. Usage example can be found in [MQTT sensor](/integrations/sensor.mqtt/#json-attributes-template-configuration) documentation." JsonAttributesTopic *string `json:"json_attributes_topic,omitempty"` // "The MQTT topic subscribed to receive a JSON dictionary payload and then set as sensor attributes. Usage example can be found in [MQTT sensor](/integrations/sensor.mqtt/#json-attributes-topic-configuration) documentation." JsonAttributesFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for json attributes Name *string `json:"name,omitempty"` // "The name of the fan. Can be set to `null` if only the device name is relevant." ObjectId *string `json:"object_id,omitempty"` // "Used instead of `name` for automatic generation of `entity_id`" Optimistic *bool `json:"optimistic,omitempty"` // "Flag that defines if fan works in optimistic mode" OscillationCommandTemplate *string `json:"oscillation_command_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to generate the payload to send to `oscillation_command_topic`." OscillationCommandTopic *string `json:"oscillation_command_topic,omitempty"` // "The MQTT topic to publish commands to change the oscillation state." OscillationCommandFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for oscillation command OscillationStateTopic *string `json:"oscillation_state_topic,omitempty"` // "The MQTT topic subscribed to receive oscillation state updates." OscillationStateFunc func() string `json:"-"` // Function for oscillation state OscillationValueTemplate *string `json:"oscillation_value_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract a value from the oscillation." PayloadAvailable *string `json:"payload_available,omitempty"` // "The payload that represents the available state." PayloadNotAvailable *string `json:"payload_not_available,omitempty"` // "The payload that represents the unavailable state." PayloadOff *string `json:"payload_off,omitempty"` // "The payload that represents the stop state." PayloadOn *string `json:"payload_on,omitempty"` // "The payload that represents the running state." PayloadOscillationOff *string `json:"payload_oscillation_off,omitempty"` // "The payload that represents the oscillation off state." PayloadOscillationOn *string `json:"payload_oscillation_on,omitempty"` // "The payload that represents the oscillation on state." PayloadResetPercentage *string `json:"payload_reset_percentage,omitempty"` // "A special payload that resets the `percentage` state attribute to `unknown` when received at the `percentage_state_topic`." PayloadResetPresetMode *string `json:"payload_reset_preset_mode,omitempty"` // "A special payload that resets the `preset_mode` state attribute to `unknown` when received at the `preset_mode_state_topic`." PercentageCommandTemplate *string `json:"percentage_command_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to generate the payload to send to `percentage_command_topic`." PercentageCommandTopic *string `json:"percentage_command_topic,omitempty"` // "The MQTT topic to publish commands to change the fan speed state based on a percentage." PercentageCommandFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for percentage command PercentageStateTopic *string `json:"percentage_state_topic,omitempty"` // "The MQTT topic subscribed to receive fan speed based on percentage." PercentageStateFunc func() string `json:"-"` // Function for percentage state PercentageValueTemplate *string `json:"percentage_value_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the `percentage` value from the payload received on `percentage_state_topic`." PresetModeCommandTemplate *string `json:"preset_mode_command_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to generate the payload to send to `preset_mode_command_topic`." PresetModeCommandTopic *string `json:"preset_mode_command_topic,omitempty"` // "The MQTT topic to publish commands to change the preset mode." PresetModeCommandFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for preset mode command PresetModeStateTopic *string `json:"preset_mode_state_topic,omitempty"` // "The MQTT topic subscribed to receive fan speed based on presets." PresetModeStateFunc func() string `json:"-"` // Function for preset mode state PresetModeValueTemplate *string `json:"preset_mode_value_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the `preset_mode` value from the payload received on `preset_mode_state_topic`." PresetModes *([]string) `json:"preset_modes,omitempty"` // "List of preset modes this fan is capable of running at. Common examples include `auto`, `smart`, `whoosh`, `eco` and `breeze`." Qos *int `json:"qos,omitempty"` // "The maximum QoS level to be used when receiving and publishing messages." Retain *bool `json:"retain,omitempty"` // "If the published message should have the retain flag on or not." SpeedRangeMax *int `json:"speed_range_max,omitempty"` // "The maximum of numeric output range (representing 100 %). The number of speeds within the `speed_range` / `100` will determine the `percentage_step`." SpeedRangeMin *int `json:"speed_range_min,omitempty"` // "The minimum of numeric output range (`off` not included, so `speed_range_min` - `1` represents 0 %). The number of speeds within the speed_range / 100 will determine the `percentage_step`." StateTopic *string `json:"state_topic,omitempty"` // "The MQTT topic subscribed to receive state updates." StateFunc func() string `json:"-"` // Function for state StateValueTemplate *string `json:"state_value_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract a value from the state." UniqueId *string `json:"unique_id,omitempty"` // "An ID that uniquely identifies this fan. If two fans have the same unique ID, Home Assistant will raise an exception." MQTT *MQTTFields `json:"-"` // MQTT configuration parameters }
////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////
func (*Fan) AddMessageHandler ¶
func (d *Fan) AddMessageHandler()
func (*Fan) AnnounceAvailable ¶
func (d *Fan) AnnounceAvailable()
func (*Fan) GetMQTTFields ¶
func (d *Fan) GetMQTTFields() (fields MQTTFields)
func (*Fan) GetUniqueId ¶
func (*Fan) Initialize ¶
func (d *Fan) Initialize()
func (*Fan) PopulateDevice ¶
func (d *Fan) PopulateDevice()
func (*Fan) PopulateTopics ¶
func (d *Fan) PopulateTopics()
func (*Fan) SetMQTTFields ¶
func (d *Fan) SetMQTTFields(fields MQTTFields)
func (*Fan) UnSubscribe ¶
func (d *Fan) UnSubscribe()
func (*Fan) UpdateState ¶
func (d *Fan) UpdateState()
type Humidifier ¶
type Humidifier struct { ActionTemplate *string `json:"action_template,omitempty"` // "A template to render the value received on the `action_topic` with." ActionTopic *string `json:"action_topic,omitempty"` // "The MQTT topic to subscribe for changes of the current action. Valid values: `off`, `humidifying`, `drying`, `idle`" ActionFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for action AvailabilityMode *string `json:"availability_mode,omitempty"` // "When `availability` is configured, this controls the conditions needed to set the entity to `available`. Valid entries are `all`, `any`, and `latest`. If set to `all`, `payload_available` must be received on all configured availability topics before the entity is marked as online. If set to `any`, `payload_available` must be received on at least one configured availability topic before the entity is marked as online. If set to `latest`, the last `payload_available` or `payload_not_available` received on any configured availability topic controls the availability." AvailabilityTemplate *string `json:"availability_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract device's availability from the `availability_topic`. To determine the devices's availability result of this template will be compared to `payload_available` and `payload_not_available`." AvailabilityTopic *string `json:"availability_topic,omitempty"` // "The MQTT topic subscribed to receive availability (online/offline) updates. Must not be used together with `availability`." AvailabilityFunc func() string `json:"-"` // Function for availability CommandTemplate *string `json:"command_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to generate the payload to send to `command_topic`." CommandTopic *string `json:"command_topic,omitempty"` // "The MQTT topic to publish commands to change the humidifier state." CommandFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for command CurrentHumidityTemplate *string `json:"current_humidity_template,omitempty"` // "A template with which the value received on `current_humidity_topic` will be rendered." CurrentHumidityTopic *string `json:"current_humidity_topic,omitempty"` // "The MQTT topic on which to listen for the current humidity. A `\"None\"` value received will reset the current humidity. Empty values (`”'`) will be ignored." CurrentHumidityFunc func() string `json:"-"` // Function for current humidity Device struct { ConfigurationUrl *string `json:"configuration_url,omitempty"` // "A link to the webpage that can manage the configuration of this device. Can be either an `http://`, `https://` or an internal `homeassistant://` URL." Connections *string `json:"connections,omitempty"` // "A list of connections of the device to the outside world as a list of tuples `[connection_type, connection_identifier]`. For example the MAC address of a network interface: `\"connections\": [[\"mac\", \"02:5b:26:a8:dc:12\"]]`." Identifiers *string `json:"identifiers,omitempty"` // "A list of IDs that uniquely identify the device. For example a serial number." Manufacturer *string `json:"manufacturer,omitempty"` // "The manufacturer of the device." Model *string `json:"model,omitempty"` // "The model of the device." Name *string `json:"name,omitempty"` // "The name of the device." SuggestedArea *string `json:"suggested_area,omitempty"` // "Suggest an area if the device isn’t in one yet." SwVersion *string `json:"sw_version,omitempty"` // "The firmware version of the device." ViaDevice *string `json:"via_device,omitempty"` // "Identifier of a device that routes messages between this device and Home Assistant. Examples of such devices are hubs, or parent devices of a sub-device. This is used to show device topology in Home Assistant." } `json:"device,omitempty"` // Device configuration parameters DeviceClass *string `json:"device_class,omitempty"` // "The device class of the MQTT device. Must be either `humidifier`, `dehumidifier` or `null`." EnabledByDefault *bool `json:"enabled_by_default,omitempty"` // "Flag which defines if the entity should be enabled when first added." Encoding *string `json:"encoding,omitempty"` // "The encoding of the payloads received and published messages. Set to `\"\"` to disable decoding of incoming payload." EntityCategory *string `json:"entity_category,omitempty"` // "The [category](https://developers.home-assistant.io/docs/core/entity#generic-properties) of the entity." Icon *string `json:"icon,omitempty"` // "[Icon](/docs/configuration/customizing-devices/#icon) for the entity." JsonAttributesTemplate *string `json:"json_attributes_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the JSON dictionary from messages received on the `json_attributes_topic`. Usage example can be found in [MQTT sensor](/integrations/sensor.mqtt/#json-attributes-template-configuration) documentation." JsonAttributesTopic *string `json:"json_attributes_topic,omitempty"` // "The MQTT topic subscribed to receive a JSON dictionary payload and then set as sensor attributes. Usage example can be found in [MQTT sensor](/integrations/sensor.mqtt/#json-attributes-topic-configuration) documentation." JsonAttributesFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for json attributes MaxHumidity *int `json:"max_humidity,omitempty"` // "The minimum target humidity percentage that can be set." MinHumidity *int `json:"min_humidity,omitempty"` // "The maximum target humidity percentage that can be set." ModeCommandTemplate *string `json:"mode_command_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to generate the payload to send to `mode_command_topic`." ModeCommandTopic *string `json:"mode_command_topic,omitempty"` // "The MQTT topic to publish commands to change the `mode` on the humidifier. This attribute ust be configured together with the `modes` attribute." ModeCommandFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for mode command ModeStateTemplate *string `json:"mode_state_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract a value for the humidifier `mode` state." ModeStateTopic *string `json:"mode_state_topic,omitempty"` // "The MQTT topic subscribed to receive the humidifier `mode`." ModeStateFunc func() string `json:"-"` // Function for mode state Modes *([]string) `json:"modes,omitempty"` // "List of available modes this humidifier is capable of running at. Common examples include `normal`, `eco`, `away`, `boost`, `comfort`, `home`, `sleep`, `auto` and `baby`. These examples offer built-in translations but other custom modes are allowed as well. This attribute ust be configured together with the `mode_command_topic` attribute." Name *string `json:"name,omitempty"` // "The name of the humidifier. Can be set to `null` if only the device name is relevant." ObjectId *string `json:"object_id,omitempty"` // "Used instead of `name` for automatic generation of `entity_id`" Optimistic *bool `json:"optimistic,omitempty"` // "Flag that defines if humidifier works in optimistic mode" PayloadAvailable *string `json:"payload_available,omitempty"` // "The payload that represents the available state." PayloadNotAvailable *string `json:"payload_not_available,omitempty"` // "The payload that represents the unavailable state." PayloadOff *string `json:"payload_off,omitempty"` // "The payload that represents the stop state." PayloadOn *string `json:"payload_on,omitempty"` // "The payload that represents the running state." PayloadResetHumidity *string `json:"payload_reset_humidity,omitempty"` // "A special payload that resets the `target_humidity` state attribute to an `unknown` state when received at the `target_humidity_state_topic`. When received at `current_humidity_topic` it will reset the current humidity state." PayloadResetMode *string `json:"payload_reset_mode,omitempty"` // "A special payload that resets the `mode` state attribute to an `unknown` state when received at the `mode_state_topic`." Qos *int `json:"qos,omitempty"` // "The maximum QoS level to be used when receiving and publishing messages." Retain *bool `json:"retain,omitempty"` // "If the published message should have the retain flag on or not." StateTopic *string `json:"state_topic,omitempty"` // "The MQTT topic subscribed to receive state updates." StateFunc func() string `json:"-"` // Function for state StateValueTemplate *string `json:"state_value_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract a value from the state." TargetHumidityCommandTemplate *string `json:"target_humidity_command_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to generate the payload to send to `target_humidity_command_topic`." TargetHumidityCommandTopic *string `json:"target_humidity_command_topic,omitempty"` // "The MQTT topic to publish commands to change the humidifier target humidity state based on a percentage." TargetHumidityCommandFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for target humidity command TargetHumidityStateTemplate *string `json:"target_humidity_state_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract a value for the humidifier `target_humidity` state." TargetHumidityStateTopic *string `json:"target_humidity_state_topic,omitempty"` // "The MQTT topic subscribed to receive humidifier target humidity." TargetHumidityStateFunc func() string `json:"-"` // Function for target humidity state UniqueId *string `json:"unique_id,omitempty"` // "An ID that uniquely identifies this humidifier. If two humidifiers have the same unique ID, Home Assistant will raise an exception." MQTT *MQTTFields `json:"-"` // MQTT configuration parameters }
////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////
func (*Humidifier) AddMessageHandler ¶
func (d *Humidifier) AddMessageHandler()
func (*Humidifier) AnnounceAvailable ¶
func (d *Humidifier) AnnounceAvailable()
func (*Humidifier) GetMQTTFields ¶
func (d *Humidifier) GetMQTTFields() (fields MQTTFields)
func (*Humidifier) GetRawId ¶
func (d *Humidifier) GetRawId() string
func (*Humidifier) GetUniqueId ¶
func (d *Humidifier) GetUniqueId() string
func (*Humidifier) Initialize ¶
func (d *Humidifier) Initialize()
func (*Humidifier) PopulateDevice ¶
func (d *Humidifier) PopulateDevice()
func (*Humidifier) PopulateTopics ¶
func (d *Humidifier) PopulateTopics()
func (*Humidifier) SetMQTTFields ¶
func (d *Humidifier) SetMQTTFields(fields MQTTFields)
func (*Humidifier) Subscribe ¶
func (d *Humidifier) Subscribe()
func (*Humidifier) UnSubscribe ¶
func (d *Humidifier) UnSubscribe()
func (*Humidifier) UpdateState ¶
func (d *Humidifier) UpdateState()
type Image ¶
type Image struct { AvailabilityMode *string `json:"availability_mode,omitempty"` // "When `availability` is configured, this controls the conditions needed to set the entity to `available`. Valid entries are `all`, `any`, and `latest`. If set to `all`, `payload_available` must be received on all configured availability topics before the entity is marked as online. If set to `any`, `payload_available` must be received on at least one configured availability topic before the entity is marked as online. If set to `latest`, the last `payload_available` or `payload_not_available` received on any configured availability topic controls the availability." AvailabilityTemplate *string `json:"availability_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract device's availability from the `availability_topic`. To determine the devices's availability result of this template will be compared to `payload_available` and `payload_not_available`." AvailabilityTopic *string `json:"availability_topic,omitempty"` // "The MQTT topic subscribed to receive availability (online/offline) updates. Must not be used together with `availability`." AvailabilityFunc func() string `json:"-"` // Function for availability ContentType *string `json:"content_type,omitempty"` // "The content type of and image data message received on `image_topic`. This option cannot be used with the `url_topic` because the content type is derived when downloading the image." Device struct { ConfigurationUrl *string `json:"configuration_url,omitempty"` // "A link to the webpage that can manage the configuration of this device. Can be either an `http://`, `https://` or an internal `homeassistant://` URL." Connections *string `json:"connections,omitempty"` // "A list of connections of the device to the outside world as a list of tuples `[connection_type, connection_identifier]`. For example the MAC address of a network interface: `\"connections\": [[\"mac\", \"02:5b:26:a8:dc:12\"]]`." Identifiers *string `json:"identifiers,omitempty"` // "A list of IDs that uniquely identify the device. For example a serial number." Manufacturer *string `json:"manufacturer,omitempty"` // "The manufacturer of the device." Model *string `json:"model,omitempty"` // "The model of the device." Name *string `json:"name,omitempty"` // "The name of the device." SuggestedArea *string `json:"suggested_area,omitempty"` // "Suggest an area if the device isn’t in one yet." SwVersion *string `json:"sw_version,omitempty"` // "The firmware version of the device." ViaDevice *string `json:"via_device,omitempty"` // "Identifier of a device that routes messages between this device and Home Assistant. Examples of such devices are hubs, or parent devices of a sub-device. This is used to show device topology in Home Assistant." } `json:"device,omitempty"` // Device configuration parameters EnabledByDefault *bool `json:"enabled_by_default,omitempty"` // "Flag which defines if the entity should be enabled when first added." Encoding *string `json:"encoding,omitempty"` // "The encoding of the payloads received. Set to `\"\"` to disable decoding of incoming payload. Use `image_encoding` to enable `Base64` decoding on `image_topic`." EntityCategory *string `json:"entity_category,omitempty"` // "The [category](https://developers.home-assistant.io/docs/core/entity#generic-properties) of the entity." Icon *string `json:"icon,omitempty"` // "[Icon](/docs/configuration/customizing-devices/#icon) for the entity." ImageEncoding *string `json:"image_encoding,omitempty"` // "The encoding of the image payloads received. Set to `\"b64\"` to enable base64 decoding of image payload. If not set, the image payload must be raw binary data." ImageTopic *string `json:"image_topic,omitempty"` // "The MQTT topic to subscribe to receive the image payload of the image to be downloaded. Ensure the `content_type` type option is set to the corresponding content type. This option cannot be used together with the `url_topic` option. But at least one of these option is required." ImageFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for image JsonAttributesTemplate *string `json:"json_attributes_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the JSON dictionary from messages received on the `json_attributes_topic`." JsonAttributesTopic *string `json:"json_attributes_topic,omitempty"` // "The MQTT topic subscribed to receive a JSON dictionary payload and then set as sensor attributes. Implies `force_update` of the current sensor state when a message is received on this topic." JsonAttributesFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for json attributes Name *string `json:"name,omitempty"` // "The name of the image. Can be set to `null` if only the device name is relevant." ObjectId *string `json:"object_id,omitempty"` // "Used instead of `name` for automatic generation of `entity_id`" UniqueId *string `json:"unique_id,omitempty"` // "An ID that uniquely identifies this image. If two images have the same unique ID Home Assistant will raise an exception." UrlTemplate *string `json:"url_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the image URL from a message received at `url_topic`." UrlTopic *string `json:"url_topic,omitempty"` // "The MQTT topic to subscribe to receive an image URL. A `url_template` option can extract the URL from the message. The `content_type` will be derived from the image when downloaded. This option cannot be used together with the `image_topic` option, but at least one of these options is required." UrlFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for url MQTT *MQTTFields `json:"-"` // MQTT configuration parameters }
////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////
func (*Image) AddMessageHandler ¶
func (d *Image) AddMessageHandler()
func (*Image) AnnounceAvailable ¶
func (d *Image) AnnounceAvailable()
func (*Image) GetMQTTFields ¶
func (d *Image) GetMQTTFields() (fields MQTTFields)
func (*Image) GetUniqueId ¶
func (*Image) Initialize ¶
func (d *Image) Initialize()
func (*Image) PopulateDevice ¶
func (d *Image) PopulateDevice()
func (*Image) PopulateTopics ¶
func (d *Image) PopulateTopics()
func (*Image) SetMQTTFields ¶
func (d *Image) SetMQTTFields(fields MQTTFields)
func (*Image) UnSubscribe ¶
func (d *Image) UnSubscribe()
func (*Image) UpdateState ¶
func (d *Image) UpdateState()
type LawnMower ¶
type LawnMower struct { ActivityStateTopic *string `json:"activity_state_topic,omitempty"` // "The MQTT topic subscribed to receive an update of the activity. Valid activities are `mowing`, `paused`, `docked`, and `error`. Use `value_template` to extract the activity state from a custom payload. When payload `none` is received, the activity state will be reset to `unknown`." ActivityStateFunc func() string `json:"-"` // Function for activity state ActivityValueTemplate *string `json:"activity_value_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the value." AvailabilityMode *string `json:"availability_mode,omitempty"` // "When `availability` is configured, this controls the conditions needed to set the entity to `available`. Valid entries are `all`, `any`, and `latest`. If set to `all`, `payload_available` must be received on all configured availability topics before the entity is marked as online. If set to `any`, `payload_available` must be received on at least one configured availability topic before the entity is marked as online. If set to `latest`, the last `payload_available` or `payload_not_available` received on any configured availability topic controls the availability." AvailabilityTemplate *string `json:"availability_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract device's availability from the `availability_topic`. To determine the devices's availability, the result of this template will be compared to `payload_available` and `payload_not_available`." AvailabilityTopic *string `json:"availability_topic,omitempty"` // "The MQTT topic subscribed to receive availability (online/offline) updates. Must not be used together with `availability`." AvailabilityFunc func() string `json:"-"` // Function for availability Device struct { ConfigurationUrl *string `json:"configuration_url,omitempty"` // "A link to the webpage that can manage the configuration of this device. Can be either an `http://`, `https://`, or an internal `homeassistant://` URL." Connections *string `json:"connections,omitempty"` // "A list of connections of the device to the outside world as a list of tuples `[connection_type, connection_identifier]`. For example the MAC address of a network interface: `\"connections\": [[\"mac\", \"02:5b:26:a8:dc:12\"]]`." Identifiers *string `json:"identifiers,omitempty"` // "A list of IDs that uniquely identify the device. For example, a serial number." Manufacturer *string `json:"manufacturer,omitempty"` // "The manufacturer of the device." Model *string `json:"model,omitempty"` // "The model of the device." Name *string `json:"name,omitempty"` // "The name of the device." SuggestedArea *string `json:"suggested_area,omitempty"` // "Suggest an area if the device isn’t in one yet." SwVersion *string `json:"sw_version,omitempty"` // "The firmware version of the device." ViaDevice *string `json:"via_device,omitempty"` // "Identifier of a device that routes messages between this device and Home Assistant. Examples of such devices are hubs or parent devices of a sub-device. This is used to show the device topology in Home Assistant." } `json:"device,omitempty"` // Device configuration parameters DockCommandTemplate *string `json:"dock_command_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to generate the payload to send to `dock_command_topic`. The `value` parameter in the template will be set to `dock`." DockCommandTopic *string `json:"dock_command_topic,omitempty"` // "The MQTT topic that publishes commands when the service `lawn_mower.dock` service call is executed. The value `dock` is published when the service is called. Use a `dock_command_template` to publish a custom format." DockCommandFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for dock command EnabledByDefault *bool `json:"enabled_by_default,omitempty"` // "Flag which defines if the entity should be enabled when first added." Encoding *string `json:"encoding,omitempty"` // "The encoding of the payloads received and published messages. Set to `\"\"` to disable decoding of the incoming payload." EntityCategory *string `json:"entity_category,omitempty"` // "The [category](https://developers.home-assistant.io/docs/core/entity#generic-properties) of the entity." Icon *string `json:"icon,omitempty"` // "[Icon](/docs/configuration/customizing-devices/#icon) for the entity." JsonAttributesTemplate *string `json:"json_attributes_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the JSON dictionary from messages received on the `json_attributes_topic`." JsonAttributesTopic *string `json:"json_attributes_topic,omitempty"` // "The MQTT topic subscribed to receive a JSON dictionary payload and then set as entity attributes. Implies `force_update` of the current activity state when a message is received on this topic." JsonAttributesFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for json attributes Name *string `json:"name,omitempty"` // "The name of the lawn mower. Can be set to `null` if only the device name is relevant." ObjectId *string `json:"object_id,omitempty"` // "Used instead of `name` for automatic generation of `entity_id`" Optimistic *bool `json:"optimistic,omitempty"` // "Flag that defines if the lawn mower works in optimistic mode." PauseCommandTemplate *string `json:"pause_command_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to generate the payload to send to `pause_command_topic`. The `value` parameter in the template will be set to `pause`." PauseCommandTopic *string `json:"pause_command_topic,omitempty"` // "The MQTT topic that publishes commands when the service `lawn_mower.pause` service call is executed. The value `pause` is published when the service is called. Use a `pause_command_template` to publish a custom format." PauseCommandFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for pause command Qos *int `json:"qos,omitempty"` // "The maximum QoS level to be used when receiving and publishing messages." Retain *bool `json:"retain,omitempty"` // "If the published message should have the retain flag on or not." StartMowingCommandTopic *string `json:"start_mowing_command_topic,omitempty"` // "The MQTT topic that publishes commands when the service `lawn_mower.start_mowing` service call is executed. The value `start_mowing` is published when the service is called. Use a `start_mowing_command_template` to publish a custom format." StartMowingCommandFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for start mowing command StartMowingTemplate *string `json:"start_mowing_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to generate the payload to send to `dock_command_topic`. The `value` parameter in the template will be set to `dock`." UniqueId *string `json:"unique_id,omitempty"` // "An ID that uniquely identifies this lawn mower. If two lawn mowers have the same unique ID, Home Assistant will raise an exception." MQTT *MQTTFields `json:"-"` // MQTT configuration parameters }
////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////
func (*LawnMower) AddMessageHandler ¶
func (d *LawnMower) AddMessageHandler()
func (*LawnMower) AnnounceAvailable ¶
func (d *LawnMower) AnnounceAvailable()
func (*LawnMower) GetMQTTFields ¶
func (d *LawnMower) GetMQTTFields() (fields MQTTFields)
func (*LawnMower) GetUniqueId ¶
func (*LawnMower) Initialize ¶
func (d *LawnMower) Initialize()
func (*LawnMower) PopulateDevice ¶
func (d *LawnMower) PopulateDevice()
func (*LawnMower) PopulateTopics ¶
func (d *LawnMower) PopulateTopics()
func (*LawnMower) SetMQTTFields ¶
func (d *LawnMower) SetMQTTFields(fields MQTTFields)
func (*LawnMower) UnSubscribe ¶
func (d *LawnMower) UnSubscribe()
func (*LawnMower) UpdateState ¶
func (d *LawnMower) UpdateState()
type Light ¶
type Light struct { AvailabilityMode *string `json:"availability_mode,omitempty"` // "When `availability` is configured, this controls the conditions needed to set the entity to `available`. Valid entries are `all`, `any`, and `latest`. If set to `all`, `payload_available` must be received on all configured availability topics before the entity is marked as online. If set to `any`, `payload_available` must be received on at least one configured availability topic before the entity is marked as online. If set to `latest`, the last `payload_available` or `payload_not_available` received on any configured availability topic controls the availability." AvailabilityTemplate *string `json:"availability_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract device's availability from the `availability_topic`. To determine the devices's availability result of this template will be compared to `payload_available` and `payload_not_available`." AvailabilityTopic *string `json:"availability_topic,omitempty"` // "The MQTT topic subscribed to receive availability (online/offline) updates. Must not be used together with `availability`." AvailabilityFunc func() string `json:"-"` // Function for availability BrightnessCommandTemplate *string `json:"brightness_command_template,omitempty"` // "Defines a [template](/docs/configuration/templating/) to compose message which will be sent to `brightness_command_topic`. Available variables: `value`." BrightnessCommandTopic *string `json:"brightness_command_topic,omitempty"` // "The MQTT topic to publish commands to change the light’s brightness." BrightnessCommandFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for brightness command BrightnessScale *int `json:"brightness_scale,omitempty"` // "Defines the maximum brightness value (i.e., 100%) of the MQTT device." BrightnessStateTopic *string `json:"brightness_state_topic,omitempty"` // "The MQTT topic subscribed to receive brightness state updates." BrightnessStateFunc func() string `json:"-"` // Function for brightness state BrightnessValueTemplate *string `json:"brightness_value_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the brightness value." ColorModeStateTopic *string `json:"color_mode_state_topic,omitempty"` // "The MQTT topic subscribed to receive color mode updates. If this is not configured, `color_mode` will be automatically set according to the last received valid color or color temperature" ColorModeStateFunc func() string `json:"-"` // Function for color mode state ColorModeValueTemplate *string `json:"color_mode_value_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the color mode." ColorTempCommandTemplate *string `json:"color_temp_command_template,omitempty"` // "Defines a [template](/docs/configuration/templating/) to compose message which will be sent to `color_temp_command_topic`. Available variables: `value`." ColorTempCommandTopic *string `json:"color_temp_command_topic,omitempty"` // "The MQTT topic to publish commands to change the light’s color temperature state. The color temperature command slider has a range of 153 to 500 mireds (micro reciprocal degrees)." ColorTempCommandFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for color temp command ColorTempStateTopic *string `json:"color_temp_state_topic,omitempty"` // "The MQTT topic subscribed to receive color temperature state updates." ColorTempStateFunc func() string `json:"-"` // Function for color temp state ColorTempValueTemplate *string `json:"color_temp_value_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the color temperature value." CommandTopic *string `json:"command_topic,omitempty"` // "The MQTT topic to publish commands to change the switch state." CommandFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for command Device struct { ConfigurationUrl *string `json:"configuration_url,omitempty"` // "A link to the webpage that can manage the configuration of this device. Can be either an `http://`, `https://` or an internal `homeassistant://` URL." Connections *string `json:"connections,omitempty"` // "A list of connections of the device to the outside world as a list of tuples `[connection_type, connection_identifier]`. For example the MAC address of a network interface: `\"connections\": [[\"mac\", \"02:5b:26:a8:dc:12\"]]`." Identifiers *string `json:"identifiers,omitempty"` // "A list of IDs that uniquely identify the device. For example a serial number." Manufacturer *string `json:"manufacturer,omitempty"` // "The manufacturer of the device." Model *string `json:"model,omitempty"` // "The model of the device." Name *string `json:"name,omitempty"` // "The name of the device." SuggestedArea *string `json:"suggested_area,omitempty"` // "Suggest an area if the device isn’t in one yet." SwVersion *string `json:"sw_version,omitempty"` // "The firmware version of the device." ViaDevice *string `json:"via_device,omitempty"` // "Identifier of a device that routes messages between this device and Home Assistant. Examples of such devices are hubs, or parent devices of a sub-device. This is used to show device topology in Home Assistant." } `json:"device,omitempty"` // Device configuration parameters EffectCommandTemplate *string `json:"effect_command_template,omitempty"` // "Defines a [template](/docs/configuration/templating/) to compose message which will be sent to `effect_command_topic`. Available variables: `value`." EffectCommandTopic *string `json:"effect_command_topic,omitempty"` // "The MQTT topic to publish commands to change the light's effect state." EffectCommandFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for effect command EffectList *([]string) `json:"effect_list,omitempty"` // "The list of effects the light supports." EffectStateTopic *string `json:"effect_state_topic,omitempty"` // "The MQTT topic subscribed to receive effect state updates." EffectStateFunc func() string `json:"-"` // Function for effect state EffectValueTemplate *string `json:"effect_value_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the effect value." EnabledByDefault *bool `json:"enabled_by_default,omitempty"` // "Flag which defines if the entity should be enabled when first added." Encoding *string `json:"encoding,omitempty"` // "The encoding of the payloads received and published messages. Set to `\"\"` to disable decoding of incoming payload." EntityCategory *string `json:"entity_category,omitempty"` // "The [category](https://developers.home-assistant.io/docs/core/entity#generic-properties) of the entity." HsCommandTemplate *string `json:"hs_command_template,omitempty"` // "Defines a [template](/docs/configuration/templating/) to compose message which will be sent to `hs_command_topic`. Available variables: `hue` and `sat`." HsCommandTopic *string `json:"hs_command_topic,omitempty"` // "The MQTT topic to publish commands to change the light's color state in HS format (Hue Saturation). Range for Hue: 0° .. 360°, Range of Saturation: 0..100. Note: Brightness is sent separately in the `brightness_command_topic`." HsCommandFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for hs command HsStateTopic *string `json:"hs_state_topic,omitempty"` // "The MQTT topic subscribed to receive color state updates in HS format. The expected payload is the hue and saturation values separated by commas, for example, `359.5,100.0`. Note: Brightness is received separately in the `brightness_state_topic`." HsStateFunc func() string `json:"-"` // Function for hs state HsValueTemplate *string `json:"hs_value_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the HS value." Icon *string `json:"icon,omitempty"` // "[Icon](/docs/configuration/customizing-devices/#icon) for the entity." JsonAttributesTemplate *string `json:"json_attributes_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the JSON dictionary from messages received on the `json_attributes_topic`. Usage example can be found in [MQTT sensor](/integrations/sensor.mqtt/#json-attributes-template-configuration) documentation." JsonAttributesTopic *string `json:"json_attributes_topic,omitempty"` // "The MQTT topic subscribed to receive a JSON dictionary payload and then set as sensor attributes. Usage example can be found in [MQTT sensor](/integrations/sensor.mqtt/#json-attributes-topic-configuration) documentation." JsonAttributesFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for json attributes MaxMireds *int `json:"max_mireds,omitempty"` // "The maximum color temperature in mireds." MinMireds *int `json:"min_mireds,omitempty"` // "The minimum color temperature in mireds." Name *string `json:"name,omitempty"` // "The name of the light. Can be set to `null` if only the device name is relevant." ObjectId *string `json:"object_id,omitempty"` // "Used instead of `name` for automatic generation of `entity_id`" OnCommandType *string `json:"on_command_type,omitempty"` // "Defines when on the payload_on is sent. Using `last` (the default) will send any style (brightness, color, etc) topics first and then a `payload_on` to the `command_topic`. Using `first` will send the `payload_on` and then any style topics. Using `brightness` will only send brightness commands instead of the `payload_on` to turn the light on." Optimistic *bool `json:"optimistic,omitempty"` // "Flag that defines if switch works in optimistic mode." PayloadAvailable *string `json:"payload_available,omitempty"` // "The payload that represents the available state." PayloadNotAvailable *string `json:"payload_not_available,omitempty"` // "The payload that represents the unavailable state." PayloadOff *string `json:"payload_off,omitempty"` // "The payload that represents disabled state." PayloadOn *string `json:"payload_on,omitempty"` // "The payload that represents enabled state." Qos *int `json:"qos,omitempty"` // "The maximum QoS level to be used when receiving and publishing messages." Retain *bool `json:"retain,omitempty"` // "If the published message should have the retain flag on or not." RgbCommandTemplate *string `json:"rgb_command_template,omitempty"` // "Defines a [template](/docs/configuration/templating/) to compose message which will be sent to `rgb_command_topic`. Available variables: `red`, `green` and `blue`." RgbCommandTopic *string `json:"rgb_command_topic,omitempty"` // "The MQTT topic to publish commands to change the light's RGB state." RgbCommandFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for rgb command RgbStateTopic *string `json:"rgb_state_topic,omitempty"` // "The MQTT topic subscribed to receive RGB state updates. The expected payload is the RGB values separated by commas, for example, `255,0,127`." RgbStateFunc func() string `json:"-"` // Function for rgb state RgbValueTemplate *string `json:"rgb_value_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the RGB value." RgbwCommandTemplate *string `json:"rgbw_command_template,omitempty"` // "Defines a [template](/docs/configuration/templating/) to compose message which will be sent to `rgbw_command_topic`. Available variables: `red`, `green`, `blue` and `white`." RgbwCommandTopic *string `json:"rgbw_command_topic,omitempty"` // "The MQTT topic to publish commands to change the light's RGBW state." RgbwCommandFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for rgbw command RgbwStateTopic *string `json:"rgbw_state_topic,omitempty"` // "The MQTT topic subscribed to receive RGBW state updates. The expected payload is the RGBW values separated by commas, for example, `255,0,127,64`." RgbwStateFunc func() string `json:"-"` // Function for rgbw state RgbwValueTemplate *string `json:"rgbw_value_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the RGBW value." RgbwwCommandTemplate *string `json:"rgbww_command_template,omitempty"` // "Defines a [template](/docs/configuration/templating/) to compose message which will be sent to `rgbww_command_topic`. Available variables: `red`, `green`, `blue`, `cold_white` and `warm_white`." RgbwwCommandTopic *string `json:"rgbww_command_topic,omitempty"` // "The MQTT topic to publish commands to change the light's RGBWW state." RgbwwCommandFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for rgbww command RgbwwStateTopic *string `json:"rgbww_state_topic,omitempty"` // "The MQTT topic subscribed to receive RGBWW state updates. The expected payload is the RGBWW values separated by commas, for example, `255,0,127,64,32`." RgbwwStateFunc func() string `json:"-"` // Function for rgbww state RgbwwValueTemplate *string `json:"rgbww_value_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the RGBWW value." Schema *string `json:"schema,omitempty"` // "The schema to use. Must be `default` or omitted to select the default schema." StateTopic *string `json:"state_topic,omitempty"` // "The MQTT topic subscribed to receive state updates." StateFunc func() string `json:"-"` // Function for state StateValueTemplate *string `json:"state_value_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the state value. The template should match the payload `on` and `off` values, so if your light uses `power on` to turn on, your `state_value_template` string should return `power on` when the switch is on. For example if the message is just `on`, your `state_value_template` should be `power {{ value }}`." UniqueId *string `json:"unique_id,omitempty"` // "An ID that uniquely identifies this light. If two lights have the same unique ID, Home Assistant will raise an exception." WhiteCommandTopic *string `json:"white_command_topic,omitempty"` // "The MQTT topic to publish commands to change the light to white mode with a given brightness." WhiteCommandFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for white command WhiteScale *int `json:"white_scale,omitempty"` // "Defines the maximum white level (i.e., 100%) of the MQTT device." XyCommandTemplate *string `json:"xy_command_template,omitempty"` // "Defines a [template](/docs/configuration/templating/) to compose message which will be sent to `xy_command_topic`. Available variables: `x` and `y`." XyCommandTopic *string `json:"xy_command_topic,omitempty"` // "The MQTT topic to publish commands to change the light's XY state." XyCommandFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for xy command XyStateTopic *string `json:"xy_state_topic,omitempty"` // "The MQTT topic subscribed to receive XY state updates. The expected payload is the X and Y color values separated by commas, for example, `0.675,0.322`." XyStateFunc func() string `json:"-"` // Function for xy state XyValueTemplate *string `json:"xy_value_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the XY value." MQTT *MQTTFields `json:"-"` // MQTT configuration parameters }
////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////
func (*Light) AddMessageHandler ¶
func (d *Light) AddMessageHandler()
func (*Light) AnnounceAvailable ¶
func (d *Light) AnnounceAvailable()
func (*Light) GetMQTTFields ¶
func (d *Light) GetMQTTFields() (fields MQTTFields)
func (*Light) GetUniqueId ¶
func (*Light) Initialize ¶
func (d *Light) Initialize()
func (*Light) PopulateDevice ¶
func (d *Light) PopulateDevice()
func (*Light) PopulateTopics ¶
func (d *Light) PopulateTopics()
func (*Light) SetMQTTFields ¶
func (d *Light) SetMQTTFields(fields MQTTFields)
func (*Light) UnSubscribe ¶
func (d *Light) UnSubscribe()
func (*Light) UpdateState ¶
func (d *Light) UpdateState()
type Lock ¶
type Lock struct { AvailabilityMode *string `json:"availability_mode,omitempty"` // "When `availability` is configured, this controls the conditions needed to set the entity to `available`. Valid entries are `all`, `any`, and `latest`. If set to `all`, `payload_available` must be received on all configured availability topics before the entity is marked as online. If set to `any`, `payload_available` must be received on at least one configured availability topic before the entity is marked as online. If set to `latest`, the last `payload_available` or `payload_not_available` received on any configured availability topic controls the availability." AvailabilityTemplate *string `json:"availability_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract device's availability from the `availability_topic`. To determine the devices's availability result of this template will be compared to `payload_available` and `payload_not_available`." AvailabilityTopic *string `json:"availability_topic,omitempty"` // "The MQTT topic subscribed to receive availability (online/offline) updates. Must not be used together with `availability`." AvailabilityFunc func() string `json:"-"` // Function for availability CodeFormat *string `json:"code_format,omitempty"` // "A regular expression to validate a supplied code when it is set during the service call to `open`, `lock` or `unlock` the MQTT lock." CommandTemplate *string `json:"command_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to generate the payload to send to `command_topic`. The lock command template accepts the parameters `value` and `code`. The `value` parameter will contain the configured value for either `payload_open`, `payload_lock` or `payload_unlock`. The `code` parameter is set during the service call to `open`, `lock` or `unlock` the MQTT lock and will be set `None` if no code was passed." CommandTopic *string `json:"command_topic,omitempty"` // "The MQTT topic to publish commands to change the lock state." CommandFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for command Device struct { ConfigurationUrl *string `json:"configuration_url,omitempty"` // "A link to the webpage that can manage the configuration of this device. Can be either an `http://`, `https://` or an internal `homeassistant://` URL." Connections *string `json:"connections,omitempty"` // "A list of connections of the device to the outside world as a list of tuples `[connection_type, connection_identifier]`. For example the MAC address of a network interface: `\"connections\": [[\"mac\", \"02:5b:26:a8:dc:12\"]]`." Identifiers *string `json:"identifiers,omitempty"` // "A list of IDs that uniquely identify the device. For example a serial number." Manufacturer *string `json:"manufacturer,omitempty"` // "The manufacturer of the device." Model *string `json:"model,omitempty"` // "The model of the device." Name *string `json:"name,omitempty"` // "The name of the device." SuggestedArea *string `json:"suggested_area,omitempty"` // "Suggest an area if the device isn’t in one yet." SwVersion *string `json:"sw_version,omitempty"` // "The firmware version of the device." ViaDevice *string `json:"via_device,omitempty"` // "Identifier of a device that routes messages between this device and Home Assistant. Examples of such devices are hubs, or parent devices of a sub-device. This is used to show device topology in Home Assistant." } `json:"device,omitempty"` // Device configuration parameters EnabledByDefault *bool `json:"enabled_by_default,omitempty"` // "Flag which defines if the entity should be enabled when first added." Encoding *string `json:"encoding,omitempty"` // "The encoding of the payloads received and published messages. Set to `\"\"` to disable decoding of incoming payload." EntityCategory *string `json:"entity_category,omitempty"` // "The [category](https://developers.home-assistant.io/docs/core/entity#generic-properties) of the entity." Icon *string `json:"icon,omitempty"` // "[Icon](/docs/configuration/customizing-devices/#icon) for the entity." JsonAttributesTemplate *string `json:"json_attributes_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the JSON dictionary from messages received on the `json_attributes_topic`. Usage example can be found in [MQTT sensor](/integrations/sensor.mqtt/#json-attributes-template-configuration) documentation." JsonAttributesTopic *string `json:"json_attributes_topic,omitempty"` // "The MQTT topic subscribed to receive a JSON dictionary payload and then set as sensor attributes. Usage example can be found in [MQTT sensor](/integrations/sensor.mqtt/#json-attributes-topic-configuration) documentation." JsonAttributesFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for json attributes Name *string `json:"name,omitempty"` // "The name of the lock. Can be set to `null` if only the device name is relevant." ObjectId *string `json:"object_id,omitempty"` // "Used instead of `name` for automatic generation of `entity_id`" Optimistic *bool `json:"optimistic,omitempty"` // "Flag that defines if lock works in optimistic mode." PayloadAvailable *string `json:"payload_available,omitempty"` // "The payload that represents the available state." PayloadLock *string `json:"payload_lock,omitempty"` // "The payload sent to the lock to lock it." PayloadNotAvailable *string `json:"payload_not_available,omitempty"` // "The payload that represents the unavailable state." PayloadOpen *string `json:"payload_open,omitempty"` // "The payload sent to the lock to open it." PayloadReset *string `json:"payload_reset,omitempty"` // "A special payload that resets the state to `unknown` when received on the `state_topic`." PayloadUnlock *string `json:"payload_unlock,omitempty"` // "The payload sent to the lock to unlock it." Qos *int `json:"qos,omitempty"` // "The maximum QoS level to be used when receiving and publishing messages." Retain *bool `json:"retain,omitempty"` // "If the published message should have the retain flag on or not." StateJammed *string `json:"state_jammed,omitempty"` // "The payload sent to `state_topic` by the lock when it's jammed." StateLocked *string `json:"state_locked,omitempty"` // "The payload sent to `state_topic` by the lock when it's locked." StateLocking *string `json:"state_locking,omitempty"` // "The payload sent to `state_topic` by the lock when it's locking." StateTopic *string `json:"state_topic,omitempty"` // "The MQTT topic subscribed to receive state updates. It accepts states configured with `state_jammed`, `state_locked`, `state_unlocked`, `state_locking` or `state_unlocking`." StateFunc func() string `json:"-"` // Function for state StateUnlocked *string `json:"state_unlocked,omitempty"` // "The payload sent to `state_topic` by the lock when it's unlocked." StateUnlocking *string `json:"state_unlocking,omitempty"` // "The payload sent to `state_topic` by the lock when it's unlocking." UniqueId *string `json:"unique_id,omitempty"` // "An ID that uniquely identifies this lock. If two locks have the same unique ID, Home Assistant will raise an exception." ValueTemplate *string `json:"value_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract a state value from the payload." MQTT *MQTTFields `json:"-"` // MQTT configuration parameters }
////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////
func (*Lock) AddMessageHandler ¶
func (d *Lock) AddMessageHandler()
func (*Lock) AnnounceAvailable ¶
func (d *Lock) AnnounceAvailable()
func (*Lock) GetMQTTFields ¶
func (d *Lock) GetMQTTFields() (fields MQTTFields)
func (*Lock) GetUniqueId ¶
func (*Lock) Initialize ¶
func (d *Lock) Initialize()
func (*Lock) PopulateDevice ¶
func (d *Lock) PopulateDevice()
func (*Lock) PopulateTopics ¶
func (d *Lock) PopulateTopics()
func (*Lock) SetMQTTFields ¶
func (d *Lock) SetMQTTFields(fields MQTTFields)
func (*Lock) UnSubscribe ¶
func (d *Lock) UnSubscribe()
func (*Lock) UpdateState ¶
func (d *Lock) UpdateState()
type MQTTFields ¶
type Number ¶
type Number struct { AvailabilityMode *string `json:"availability_mode,omitempty"` // "When `availability` is configured, this controls the conditions needed to set the entity to `available`. Valid entries are `all`, `any`, and `latest`. If set to `all`, `payload_available` must be received on all configured availability topics before the entity is marked as online. If set to `any`, `payload_available` must be received on at least one configured availability topic before the entity is marked as online. If set to `latest`, the last `payload_available` or `payload_not_available` received on any configured availability topic controls the availability." AvailabilityTopic *string `json:"availability_topic,omitempty"` // "The MQTT topic subscribed to receive availability (online/offline) updates. Must not be used together with `availability`." AvailabilityFunc func() string `json:"-"` // Function for availability CommandTemplate *string `json:"command_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to generate the payload to send to `command_topic`." CommandTopic *string `json:"command_topic,omitempty"` // "The MQTT topic to publish commands to change the number." CommandFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for command Device struct { ConfigurationUrl *string `json:"configuration_url,omitempty"` // "A link to the webpage that can manage the configuration of this device. Can be either an `http://`, `https://` or an internal `homeassistant://` URL." Connections *string `json:"connections,omitempty"` // "A list of connections of the device to the outside world as a list of tuples `[connection_type, connection_identifier]`. For example the MAC address of a network interface: `\"connections\": [[\"mac\", \"02:5b:26:a8:dc:12\"]]`." Identifiers *string `json:"identifiers,omitempty"` // "A list of IDs that uniquely identify the device. For example a serial number." Manufacturer *string `json:"manufacturer,omitempty"` // "The manufacturer of the device." Model *string `json:"model,omitempty"` // "The model of the device." Name *string `json:"name,omitempty"` // "The name of the device." SuggestedArea *string `json:"suggested_area,omitempty"` // "Suggest an area if the device isn’t in one yet." SwVersion *string `json:"sw_version,omitempty"` // "The firmware version of the device." ViaDevice *string `json:"via_device,omitempty"` // "Identifier of a device that routes messages between this device and Home Assistant. Examples of such devices are hubs, or parent devices of a sub-device. This is used to show device topology in Home Assistant." } `json:"device,omitempty"` // Device configuration parameters DeviceClass *string `json:"device_class,omitempty"` // "The [type/class](/integrations/number/#device-class) of the number. The `device_class` can be `null`." EnabledByDefault *bool `json:"enabled_by_default,omitempty"` // "Flag which defines if the entity should be enabled when first added." Encoding *string `json:"encoding,omitempty"` // "The encoding of the payloads received and published messages. Set to `\"\"` to disable decoding of incoming payload." EntityCategory *string `json:"entity_category,omitempty"` // "The [category](https://developers.home-assistant.io/docs/core/entity#generic-properties) of the entity." Icon *string `json:"icon,omitempty"` // "[Icon](/docs/configuration/customizing-devices/#icon) for the entity." JsonAttributesTemplate *string `json:"json_attributes_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the JSON dictionary from messages received on the `json_attributes_topic`." JsonAttributesTopic *string `json:"json_attributes_topic,omitempty"` // "The MQTT topic subscribed to receive a JSON dictionary payload and then set as number attributes. Implies `force_update` of the current number state when a message is received on this topic." JsonAttributesFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for json attributes Max *float64 `json:"max,omitempty"` // "Maximum value." Min *float64 `json:"min,omitempty"` // "Minimum value." Mode *string `json:"mode,omitempty"` // "Control how the number should be displayed in the UI. Can be set to `box` or `slider` to force a display mode." Name *string `json:"name,omitempty"` // "The name of the Number. Can be set to `null` if only the device name is relevant." ObjectId *string `json:"object_id,omitempty"` // "Used instead of `name` for automatic generation of `entity_id`" Optimistic *bool `json:"optimistic,omitempty"` // "Flag that defines if number works in optimistic mode." PayloadReset *string `json:"payload_reset,omitempty"` // "A special payload that resets the state to `unknown` when received on the `state_topic`." Qos *int `json:"qos,omitempty"` // "The maximum QoS level to be used when receiving and publishing messages." Retain *bool `json:"retain,omitempty"` // "If the published message should have the retain flag on or not." StateTopic *string `json:"state_topic,omitempty"` // "The MQTT topic subscribed to receive number values." StateFunc func() string `json:"-"` // Function for state Step *float64 `json:"step,omitempty"` // "Step value. Smallest value `0.001`." UniqueId *string `json:"unique_id,omitempty"` // "An ID that uniquely identifies this Number. If two Numbers have the same unique ID Home Assistant will raise an exception." UnitOfMeasurement *string `json:"unit_of_measurement,omitempty"` // "Defines the unit of measurement of the sensor, if any. The `unit_of_measurement` can be `null`." ValueTemplate *string `json:"value_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the value." MQTT *MQTTFields `json:"-"` // MQTT configuration parameters }
////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////
func (*Number) AddMessageHandler ¶
func (d *Number) AddMessageHandler()
func (*Number) AnnounceAvailable ¶
func (d *Number) AnnounceAvailable()
func (*Number) GetMQTTFields ¶
func (d *Number) GetMQTTFields() (fields MQTTFields)
func (*Number) GetUniqueId ¶
func (*Number) Initialize ¶
func (d *Number) Initialize()
func (*Number) PopulateDevice ¶
func (d *Number) PopulateDevice()
func (*Number) PopulateTopics ¶
func (d *Number) PopulateTopics()
func (*Number) SetMQTTFields ¶
func (d *Number) SetMQTTFields(fields MQTTFields)
func (*Number) UnSubscribe ¶
func (d *Number) UnSubscribe()
func (*Number) UpdateState ¶
func (d *Number) UpdateState()
type Scene ¶
type Scene struct { AvailabilityMode *string `json:"availability_mode,omitempty"` // "When `availability` is configured, this controls the conditions needed to set the entity to `available`. Valid entries are `all`, `any`, and `latest`. If set to `all`, `payload_available` must be received on all configured availability topics before the entity is marked as online. If set to `any`, `payload_available` must be received on at least one configured availability topic before the entity is marked as online. If set to `latest`, the last `payload_available` or `payload_not_available` received on any configured availability topic controls the availability." AvailabilityTemplate *string `json:"availability_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract device's availability from the `availability_topic`. To determine the devices's availability result of this template will be compared to `payload_available` and `payload_not_available`." AvailabilityTopic *string `json:"availability_topic,omitempty"` // "The MQTT topic subscribed to receive availability (online/offline) updates. Must not be used together with `availability`." AvailabilityFunc func() string `json:"-"` // Function for availability CommandTopic *string `json:"command_topic,omitempty"` // "The MQTT topic to publish `payload_on` to activate the scene." CommandFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for command Device struct { ConfigurationUrl *string `json:"configuration_url,omitempty"` // "A link to the webpage that can manage the configuration of this device. Can be either an HTTP or HTTPS link." Connections *string `json:"connections,omitempty"` // "A list of connections of the device to the outside world as a list of tuples `[connection_type, connection_identifier]`. For example the MAC address of a network interface: `\"connections\": [[\"mac\", \"02:5b:26:a8:dc:12\"]]`." Identifiers *string `json:"identifiers,omitempty"` // "A list of IDs that uniquely identify the device. For example a serial number." Manufacturer *string `json:"manufacturer,omitempty"` // "The manufacturer of the device." Model *string `json:"model,omitempty"` // "The model of the device." Name *string `json:"name,omitempty"` // "The name of the device." SuggestedArea *string `json:"suggested_area,omitempty"` // "Suggest an area if the device isn’t in one yet." SwVersion *string `json:"sw_version,omitempty"` // "The firmware version of the device." ViaDevice *string `json:"via_device,omitempty"` // "Identifier of a device that routes messages between this device and Home Assistant. Examples of such devices are hubs, or parent devices of a sub-device. This is used to show device topology in Home Assistant." } `json:"device,omitempty"` // Device configuration parameters EnabledByDefault *bool `json:"enabled_by_default,omitempty"` // "Flag which defines if the entity should be enabled when first added." Encoding *string `json:"encoding,omitempty"` // "The encoding of the published messages." EntityCategory *string `json:"entity_category,omitempty"` // "The [category](https://developers.home-assistant.io/docs/core/entity#generic-properties) of the entity." Icon *string `json:"icon,omitempty"` // "Icon for the scene." JsonAttributesTemplate *string `json:"json_attributes_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the JSON dictionary from messages received on the `json_attributes_topic`. Usage example can be found in [MQTT sensor](/integrations/sensor.mqtt/#json-attributes-template-configuration) documentation." JsonAttributesTopic *string `json:"json_attributes_topic,omitempty"` // "The MQTT topic subscribed to receive a JSON dictionary payload and then set as sensor attributes. Usage example can be found in [MQTT sensor](/integrations/sensor.mqtt/#json-attributes-topic-configuration) documentation." JsonAttributesFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for json attributes Name *string `json:"name,omitempty"` // "The name to use when displaying this scene." ObjectId *string `json:"object_id,omitempty"` // "Used instead of `name` for automatic generation of `entity_id`" PayloadAvailable *string `json:"payload_available,omitempty"` // "The payload that represents the available state." PayloadNotAvailable *string `json:"payload_not_available,omitempty"` // "The payload that represents the unavailable state." PayloadOn *string `json:"payload_on,omitempty"` // "The payload that will be sent to `command_topic` when activating the MQTT scene." Qos *int `json:"qos,omitempty"` // "The maximum QoS level to be used when receiving and publishing messages." Retain *bool `json:"retain,omitempty"` // "If the published message should have the retain flag on or not." UniqueId *string `json:"unique_id,omitempty"` // "An ID that uniquely identifies this scene entity. If two scenes have the same unique ID, Home Assistant will raise an exception." MQTT *MQTTFields `json:"-"` // MQTT configuration parameters }
////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////
func (*Scene) AddMessageHandler ¶
func (d *Scene) AddMessageHandler()
func (*Scene) AnnounceAvailable ¶
func (d *Scene) AnnounceAvailable()
func (*Scene) GetMQTTFields ¶
func (d *Scene) GetMQTTFields() (fields MQTTFields)
func (*Scene) GetUniqueId ¶
func (*Scene) Initialize ¶
func (d *Scene) Initialize()
func (*Scene) PopulateDevice ¶
func (d *Scene) PopulateDevice()
func (*Scene) PopulateTopics ¶
func (d *Scene) PopulateTopics()
func (*Scene) SetMQTTFields ¶
func (d *Scene) SetMQTTFields(fields MQTTFields)
func (*Scene) UnSubscribe ¶
func (d *Scene) UnSubscribe()
func (*Scene) UpdateState ¶
func (d *Scene) UpdateState()
type Select ¶
type Select struct { AvailabilityMode *string `json:"availability_mode,omitempty"` // "When `availability` is configured, this controls the conditions needed to set the entity to `available`. Valid entries are `all`, `any`, and `latest`. If set to `all`, `payload_available` must be received on all configured availability topics before the entity is marked as online. If set to `any`, `payload_available` must be received on at least one configured availability topic before the entity is marked as online. If set to `latest`, the last `payload_available` or `payload_not_available` received on any configured availability topic controls the availability." AvailabilityTemplate *string `json:"availability_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract device's availability from the `availability_topic`. To determine the devices's availability result of this template will be compared to `payload_available` and `payload_not_available`." AvailabilityTopic *string `json:"availability_topic,omitempty"` // "The MQTT topic subscribed to receive availability (online/offline) updates. Must not be used together with `availability`." AvailabilityFunc func() string `json:"-"` // Function for availability CommandTemplate *string `json:"command_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to generate the payload to send to `command_topic`." CommandTopic *string `json:"command_topic,omitempty"` // "The MQTT topic to publish commands to change the selected option." CommandFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for command Device struct { ConfigurationUrl *string `json:"configuration_url,omitempty"` // "A link to the webpage that can manage the configuration of this device. Can be either an `http://`, `https://` or an internal `homeassistant://` URL." Connections *string `json:"connections,omitempty"` // "A list of connections of the device to the outside world as a list of tuples `[connection_type, connection_identifier]`. For example the MAC address of a network interface: `\"connections\": [[\"mac\", \"02:5b:26:a8:dc:12\"]]`." Identifiers *string `json:"identifiers,omitempty"` // "A list of IDs that uniquely identify the device. For example a serial number." Manufacturer *string `json:"manufacturer,omitempty"` // "The manufacturer of the device." Model *string `json:"model,omitempty"` // "The model of the device." Name *string `json:"name,omitempty"` // "The name of the device." SuggestedArea *string `json:"suggested_area,omitempty"` // "Suggest an area if the device isn’t in one yet." SwVersion *string `json:"sw_version,omitempty"` // "The firmware version of the device." ViaDevice *string `json:"via_device,omitempty"` // "Identifier of a device that routes messages between this device and Home Assistant. Examples of such devices are hubs, or parent devices of a sub-device. This is used to show device topology in Home Assistant." } `json:"device,omitempty"` // Device configuration parameters EnabledByDefault *bool `json:"enabled_by_default,omitempty"` // "Flag which defines if the entity should be enabled when first added." Encoding *string `json:"encoding,omitempty"` // "The encoding of the payloads received and published messages. Set to `\"\"` to disable decoding of incoming payload." EntityCategory *string `json:"entity_category,omitempty"` // "The [category](https://developers.home-assistant.io/docs/core/entity#generic-properties) of the entity." Icon *string `json:"icon,omitempty"` // "[Icon](/docs/configuration/customizing-devices/#icon) for the entity." JsonAttributesTemplate *string `json:"json_attributes_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the JSON dictionary from messages received on the `json_attributes_topic`." JsonAttributesTopic *string `json:"json_attributes_topic,omitempty"` // "The MQTT topic subscribed to receive a JSON dictionary payload and then set as entity attributes. Implies `force_update` of the current select state when a message is received on this topic." JsonAttributesFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for json attributes Name *string `json:"name,omitempty"` // "The name of the Select. Can be set to `null` if only the device name is relevant." ObjectId *string `json:"object_id,omitempty"` // "Used instead of `name` for automatic generation of `entity_id`" Optimistic *bool `json:"optimistic,omitempty"` // "Flag that defines if the select works in optimistic mode." Options *([]string) `json:"options,omitempty"` // "List of options that can be selected. An empty list or a list with a single item is allowed." Qos *int `json:"qos,omitempty"` // "The maximum QoS level to be used when receiving and publishing messages." Retain *bool `json:"retain,omitempty"` // "If the published message should have the retain flag on or not." StateTopic *string `json:"state_topic,omitempty"` // "The MQTT topic subscribed to receive update of the selected option." StateFunc func() string `json:"-"` // Function for state UniqueId *string `json:"unique_id,omitempty"` // "An ID that uniquely identifies this Select. If two Selects have the same unique ID Home Assistant will raise an exception." ValueTemplate *string `json:"value_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the value." MQTT *MQTTFields `json:"-"` // MQTT configuration parameters }
////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////
func (*Select) AddMessageHandler ¶
func (d *Select) AddMessageHandler()
func (*Select) AnnounceAvailable ¶
func (d *Select) AnnounceAvailable()
func (*Select) GetMQTTFields ¶
func (d *Select) GetMQTTFields() (fields MQTTFields)
func (*Select) GetUniqueId ¶
func (*Select) Initialize ¶
func (d *Select) Initialize()
func (*Select) PopulateDevice ¶
func (d *Select) PopulateDevice()
func (*Select) PopulateTopics ¶
func (d *Select) PopulateTopics()
func (*Select) SetMQTTFields ¶
func (d *Select) SetMQTTFields(fields MQTTFields)
func (*Select) UnSubscribe ¶
func (d *Select) UnSubscribe()
func (*Select) UpdateState ¶
func (d *Select) UpdateState()
type Sensor ¶
type Sensor struct { AvailabilityMode *string `json:"availability_mode,omitempty"` // "When `availability` is configured, this controls the conditions needed to set the entity to `available`. Valid entries are `all`, `any`, and `latest`. If set to `all`, `payload_available` must be received on all configured availability topics before the entity is marked as online. If set to `any`, `payload_available` must be received on at least one configured availability topic before the entity is marked as online. If set to `latest`, the last `payload_available` or `payload_not_available` received on any configured availability topic controls the availability." AvailabilityTemplate *string `json:"availability_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract device's availability from the `availability_topic`. To determine the devices's availability result of this template will be compared to `payload_available` and `payload_not_available`." AvailabilityTopic *string `json:"availability_topic,omitempty"` // "The MQTT topic subscribed to receive availability (online/offline) updates." AvailabilityFunc func() string `json:"-"` // Function for availability Device struct { ConfigurationUrl *string `json:"configuration_url,omitempty"` // "A link to the webpage that can manage the configuration of this device. Can be either an `http://`, `https://` or an internal `homeassistant://` URL." Connections *string `json:"connections,omitempty"` // "A list of connections of the device to the outside world as a list of tuples `[connection_type, connection_identifier]`. For example the MAC address of a network interface: `\"connections\": [[\"mac\", \"02:5b:26:a8:dc:12\"]]`." Identifiers *string `json:"identifiers,omitempty"` // "A list of IDs that uniquely identify the device. For example a serial number." Manufacturer *string `json:"manufacturer,omitempty"` // "The manufacturer of the device." Model *string `json:"model,omitempty"` // "The model of the device." Name *string `json:"name,omitempty"` // "The name of the device." SuggestedArea *string `json:"suggested_area,omitempty"` // "Suggest an area if the device isn’t in one yet." SwVersion *string `json:"sw_version,omitempty"` // "The firmware version of the device." ViaDevice *string `json:"via_device,omitempty"` // "Identifier of a device that routes messages between this device and Home Assistant. Examples of such devices are hubs, or parent devices of a sub-device. This is used to show device topology in Home Assistant." } `json:"device,omitempty"` // Device configuration parameters DeviceClass *string `json:"device_class,omitempty"` // "The [type/class](/integrations/sensor/#device-class) of the sensor to set the icon in the frontend. The `device_class` can be `null`." EnabledByDefault *bool `json:"enabled_by_default,omitempty"` // "Flag which defines if the entity should be enabled when first added." Encoding *string `json:"encoding,omitempty"` // "The encoding of the payloads received. Set to `\"\"` to disable decoding of incoming payload." EntityCategory *string `json:"entity_category,omitempty"` // "The [category](https://developers.home-assistant.io/docs/core/entity#generic-properties) of the entity. When set, the entity category must be `diagnostic` for sensors." ExpireAfter *int `json:"expire_after,omitempty"` // "If set, it defines the number of seconds after the sensor's state expires, if it's not updated. After expiry, the sensor's state becomes `unavailable`. Default the sensors state never expires." ForceUpdate *bool `json:"force_update,omitempty"` // "Sends update events even if the value hasn't changed. Useful if you want to have meaningful value graphs in history." Icon *string `json:"icon,omitempty"` // "[Icon](/docs/configuration/customizing-devices/#icon) for the entity." JsonAttributesTemplate *string `json:"json_attributes_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the JSON dictionary from messages received on the `json_attributes_topic`." JsonAttributesTopic *string `json:"json_attributes_topic,omitempty"` // "The MQTT topic subscribed to receive a JSON dictionary payload and then set as sensor attributes. Implies `force_update` of the current sensor state when a message is received on this topic." JsonAttributesFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for json attributes LastResetValueTemplate *string `json:"last_reset_value_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the last_reset. Available variables: `entity_id`. The `entity_id` can be used to reference the entity's attributes." Name *string `json:"name,omitempty"` // "The name of the MQTT sensor. Can be set to `null` if only the device name is relevant." ObjectId *string `json:"object_id,omitempty"` // "Used instead of `name` for automatic generation of `entity_id`" PayloadAvailable *string `json:"payload_available,omitempty"` // "The payload that represents the available state." PayloadNotAvailable *string `json:"payload_not_available,omitempty"` // "The payload that represents the unavailable state." Qos *int `json:"qos,omitempty"` // "The maximum QoS level to be used when receiving and publishing messages." StateClass *string `json:"state_class,omitempty"` // "The [state_class](https://developers.home-assistant.io/docs/core/entity/sensor#available-state-classes) of the sensor." StateTopic *string `json:"state_topic,omitempty"` // "The MQTT topic subscribed to receive sensor values. If `device_class`, `state_class`, `unit_of_measurement` or `suggested_display_precision` is set, and a numeric value is expected, an empty value `”` will be ignored and will not update the state, a `'null'` value will set the sensor to an `unknown` state. The `device_class` can be `null`." StateFunc func() string `json:"-"` // Function for state SuggestedDisplayPrecision *int `json:"suggested_display_precision,omitempty"` // "The number of decimals which should be used in the sensor's state after rounding." UniqueId *string `json:"unique_id,omitempty"` // "An ID that uniquely identifies this sensor. If two sensors have the same unique ID, Home Assistant will raise an exception." UnitOfMeasurement *string `json:"unit_of_measurement,omitempty"` // "Defines the units of measurement of the sensor, if any. The `unit_of_measurement` can be `null`." ValueTemplate *string `json:"value_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the value. If the template throws an error, the current state will be used instead." MQTT *MQTTFields `json:"-"` // MQTT configuration parameters }
////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////
func (*Sensor) AddMessageHandler ¶
func (d *Sensor) AddMessageHandler()
func (*Sensor) AnnounceAvailable ¶
func (d *Sensor) AnnounceAvailable()
func (*Sensor) GetMQTTFields ¶
func (d *Sensor) GetMQTTFields() (fields MQTTFields)
func (*Sensor) GetUniqueId ¶
func (*Sensor) Initialize ¶
func (d *Sensor) Initialize()
func (*Sensor) PopulateDevice ¶
func (d *Sensor) PopulateDevice()
func (*Sensor) PopulateTopics ¶
func (d *Sensor) PopulateTopics()
func (*Sensor) SetMQTTFields ¶
func (d *Sensor) SetMQTTFields(fields MQTTFields)
func (*Sensor) UnSubscribe ¶
func (d *Sensor) UnSubscribe()
func (*Sensor) UpdateState ¶
func (d *Sensor) UpdateState()
type Siren ¶
type Siren struct { AvailabilityMode *string `json:"availability_mode,omitempty"` // "When `availability` is configured, this controls the conditions needed to set the entity to `available`. Valid entries are `all`, `any`, and `latest`. If set to `all`, `payload_available` must be received on all configured availability topics before the entity is marked as online. If set to `any`, `payload_available` must be received on at least one configured availability topic before the entity is marked as online. If set to `latest`, the last `payload_available` or `payload_not_available` received on any configured availability topic controls the availability." AvailabilityTemplate *string `json:"availability_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract device's availability from the `availability_topic`. To determine the devices's availability result of this template will be compared to `payload_available` and `payload_not_available`." AvailabilityTopic *string `json:"availability_topic,omitempty"` // "The MQTT topic subscribed to receive availability (online/offline) updates. Must not be used together with `availability`." AvailabilityFunc func() string `json:"-"` // Function for availability AvailableTones *([]string) `json:"available_tones,omitempty"` // "A list of available tones the siren supports. When configured, this enables the support for setting a `tone` and enables the `tone` state attribute." CommandOffTemplate *string `json:"command_off_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to generate a custom payload to send to `command_topic` when the siren turn off service is called. By default `command_template` will be used as template for service turn off. The variable `value` will be assigned with the configured `payload_off` setting." CommandTemplate *string `json:"command_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to generate a custom payload to send to `command_topic`. The variable `value` will be assigned with the configured `payload_on` or `payload_off` setting. The siren turn on service parameters `tone`, `volume_level` or `duration` can be used as variables in the template. When operation in optimistic mode the corresponding state attributes will be set. Turn on parameters will be filtered if a device misses the support." CommandTopic *string `json:"command_topic,omitempty"` // "The MQTT topic to publish commands to change the siren state. Without command templates, a default JSON payload like `{\"state\":\"ON\", \"tone\": \"bell\", \"duration\": 10, \"volume_level\": 0.5 }` is published. When the siren turn on service is called, the startup parameters will be added to the JSON payload. The `state` value of the JSON payload will be set to the the `payload_on` or `payload_off` configured payload.\n" CommandFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for command Device struct { ConfigurationUrl *string `json:"configuration_url,omitempty"` // "A link to the webpage that can manage the configuration of this device. Can be either an `http://`, `https://` or an internal `homeassistant://` URL." Connections *string `json:"connections,omitempty"` // "A list of connections of the device to the outside world as a list of tuples `[connection_type, connection_identifier]`. For example the MAC address of a network interface: `\"connections\": [[\"mac\", \"02:5b:26:a8:dc:12\"]]`." Identifiers *string `json:"identifiers,omitempty"` // "A list of IDs that uniquely identify the device. For example a serial number." Manufacturer *string `json:"manufacturer,omitempty"` // "The manufacturer of the device." Model *string `json:"model,omitempty"` // "The model of the device." Name *string `json:"name,omitempty"` // "The name of the device." SuggestedArea *string `json:"suggested_area,omitempty"` // "Suggest an area if the device isn’t in one yet." SwVersion *string `json:"sw_version,omitempty"` // "The firmware version of the device." ViaDevice *string `json:"via_device,omitempty"` // "Identifier of a device that routes messages between this device and Home Assistant. Examples of such devices are hubs, or parent devices of a sub-device. This is used to show device topology in Home Assistant." } `json:"device,omitempty"` // Device configuration parameters EnabledByDefault *bool `json:"enabled_by_default,omitempty"` // "Flag which defines if the entity should be enabled when first added." Encoding *string `json:"encoding,omitempty"` // "The encoding of the payloads received and published messages. Set to `\"\"` to disable decoding of incoming payload." EntityCategory *string `json:"entity_category,omitempty"` // "The [category](https://developers.home-assistant.io/docs/core/entity#generic-properties) of the entity." Icon *string `json:"icon,omitempty"` // "[Icon](/docs/configuration/customizing-devices/#icon) for the entity." JsonAttributesTemplate *string `json:"json_attributes_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the JSON dictionary from messages received on the `json_attributes_topic`. Usage example can be found in [MQTT sensor](/integrations/sensor.mqtt/#json-attributes-template-configuration) documentation." JsonAttributesTopic *string `json:"json_attributes_topic,omitempty"` // "The MQTT topic subscribed to receive a JSON dictionary payload and then set as sensor attributes. Usage example can be found in [MQTT sensor](/integrations/sensor.mqtt/#json-attributes-topic-configuration) documentation." JsonAttributesFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for json attributes Name *string `json:"name,omitempty"` // "The name to use when displaying this siren. Can be set to `null` if only the device name is relevant." ObjectId *string `json:"object_id,omitempty"` // "Used instead of `name` for automatic generation of `entity_id`" Optimistic *bool `json:"optimistic,omitempty"` // "Flag that defines if siren works in optimistic mode." PayloadAvailable *string `json:"payload_available,omitempty"` // "The payload that represents the available state." PayloadNotAvailable *string `json:"payload_not_available,omitempty"` // "The payload that represents the unavailable state." PayloadOff *string `json:"payload_off,omitempty"` // "The payload that represents `off` state. If specified, will be used for both comparing to the value in the `state_topic` (see `value_template` and `state_off` for details) and sending as `off` command to the `command_topic`." PayloadOn *string `json:"payload_on,omitempty"` // "The payload that represents `on` state. If specified, will be used for both comparing to the value in the `state_topic` (see `value_template` and `state_on` for details) and sending as `on` command to the `command_topic`." Qos *int `json:"qos,omitempty"` // "The maximum QoS level to be used when receiving and publishing messages." Retain *bool `json:"retain,omitempty"` // "If the published message should have the retain flag on or not." StateOff *string `json:"state_off,omitempty"` // "The payload that represents the `off` state. Used when value that represents `off` state in the `state_topic` is different from value that should be sent to the `command_topic` to turn the device `off`." StateOn *string `json:"state_on,omitempty"` // "The payload that represents the `on` state. Used when value that represents `on` state in the `state_topic` is different from value that should be sent to the `command_topic` to turn the device `on`." StateTopic *string `json:"state_topic,omitempty"` // "The MQTT topic subscribed to receive state updates. The state update may be either JSON or a simple string. When a JSON payload is detected, the `state` value of the JSON payload should supply the `payload_on` or `payload_off` defined payload to turn the siren on or off. Additionally, the state attributes `duration`, `tone` and `volume_level` can be updated. Use `value_template` to transform the received state udpate to a compliant JSON payload. Attributes will only be set if the function is supported by the device and a valid value is supplied. When a non JSON payload is detected, it should be either of the `payload_on` or `payload_off` defined payloads or `None` to reset the siren's state to `unknown`. The initial state will be `unknown`. The state will be reset to `unknown` if a `None` payload or `null` JSON value is received as a state update." StateFunc func() string `json:"-"` // Function for state StateValueTemplate *string `json:"state_value_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract device's state from the `state_topic`. To determine the siren's state result of this template will be compared to `state_on` and `state_off`. Alternatively `value_template` can be used to render to a valid JSON payload." SupportDuration *bool `json:"support_duration,omitempty"` // "Set to `true` if the MQTT siren supports the `duration` service turn on parameter and enables the `duration` state attribute." SupportVolumeSet *bool `json:"support_volume_set,omitempty"` // "Set to `true` if the MQTT siren supports the `volume_set` service turn on parameter and enables the `volume_level` state attribute." UniqueId *string `json:"unique_id,omitempty"` // "An ID that uniquely identifies this siren device. If two sirens have the same unique ID, Home Assistant will raise an exception." MQTT *MQTTFields `json:"-"` // MQTT configuration parameters }
////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////
func (*Siren) AddMessageHandler ¶
func (d *Siren) AddMessageHandler()
func (*Siren) AnnounceAvailable ¶
func (d *Siren) AnnounceAvailable()
func (*Siren) GetMQTTFields ¶
func (d *Siren) GetMQTTFields() (fields MQTTFields)
func (*Siren) GetUniqueId ¶
func (*Siren) Initialize ¶
func (d *Siren) Initialize()
func (*Siren) PopulateDevice ¶
func (d *Siren) PopulateDevice()
func (*Siren) PopulateTopics ¶
func (d *Siren) PopulateTopics()
func (*Siren) SetMQTTFields ¶
func (d *Siren) SetMQTTFields(fields MQTTFields)
func (*Siren) UnSubscribe ¶
func (d *Siren) UnSubscribe()
func (*Siren) UpdateState ¶
func (d *Siren) UpdateState()
type StateStore ¶
type StateStore struct { AlarmControlPanel struct { Availability map[string]string State map[string]string } BinarySensor struct { Availability map[string]string State map[string]string } Button struct { Availability map[string]string } Camera struct { Availability map[string]string State map[string]string } Climate struct { Availability map[string]string CurrentHumidity map[string]string CurrentTemperature map[string]string FanModeState map[string]string ModeState map[string]string PresetModeState map[string]string SwingModeState map[string]string TargetHumidityState map[string]string TemperatureHighState map[string]string TemperatureLowState map[string]string TemperatureState map[string]string } Cover struct { Availability map[string]string Position map[string]string State map[string]string TiltStatus map[string]string } DeviceTracker struct { Availability map[string]string State map[string]string } DeviceTrigger struct { State map[string]string } Event struct { Availability map[string]string State map[string]string } Fan struct { Availability map[string]string DirectionState map[string]string OscillationState map[string]string PercentageState map[string]string PresetModeState map[string]string State map[string]string } Humidifier struct { Availability map[string]string CurrentHumidity map[string]string ModeState map[string]string State map[string]string TargetHumidityState map[string]string } Image struct { Availability map[string]string } LawnMower struct { ActivityState map[string]string Availability map[string]string } Light struct { Availability map[string]string BrightnessState map[string]string ColorModeState map[string]string ColorTempState map[string]string EffectState map[string]string HsState map[string]string RgbState map[string]string RgbwState map[string]string RgbwwState map[string]string State map[string]string XyState map[string]string } Lock struct { Availability map[string]string State map[string]string } Number struct { Availability map[string]string State map[string]string } Scene struct { Availability map[string]string } Select struct { Availability map[string]string State map[string]string } Sensor struct { Availability map[string]string State map[string]string } Siren struct { Availability map[string]string State map[string]string } Switch struct { Availability map[string]string State map[string]string } Tag struct { State map[string]string } Text struct { Availability map[string]string State map[string]string } Update struct { Availability map[string]string State map[string]string } Vacuum struct { Availability map[string]string State map[string]string } Valve struct { Availability map[string]string State map[string]string } WaterHeater struct { Availability map[string]string CurrentTemperature map[string]string ModeState map[string]string TemperatureState map[string]string } }
////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////
type Switch ¶
type Switch struct { AvailabilityMode *string `json:"availability_mode,omitempty"` // "When `availability` is configured, this controls the conditions needed to set the entity to `available`. Valid entries are `all`, `any`, and `latest`. If set to `all`, `payload_available` must be received on all configured availability topics before the entity is marked as online. If set to `any`, `payload_available` must be received on at least one configured availability topic before the entity is marked as online. If set to `latest`, the last `payload_available` or `payload_not_available` received on any configured availability topic controls the availability." AvailabilityTemplate *string `json:"availability_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract device's availability from the `availability_topic`. To determine the devices's availability result of this template will be compared to `payload_available` and `payload_not_available`." AvailabilityTopic *string `json:"availability_topic,omitempty"` // "The MQTT topic subscribed to receive availability (online/offline) updates. Must not be used together with `availability`." AvailabilityFunc func() string `json:"-"` // Function for availability CommandTopic *string `json:"command_topic,omitempty"` // "The MQTT topic to publish commands to change the switch state." CommandFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for command Device struct { ConfigurationUrl *string `json:"configuration_url,omitempty"` // "A link to the webpage that can manage the configuration of this device. Can be either an `http://`, `https://` or an internal `homeassistant://` URL." Connections *string `json:"connections,omitempty"` // "A list of connections of the device to the outside world as a list of tuples `[connection_type, connection_identifier]`. For example the MAC address of a network interface: `\"connections\": [[\"mac\", \"02:5b:26:a8:dc:12\"]]`." Identifiers *string `json:"identifiers,omitempty"` // "A list of IDs that uniquely identify the device. For example a serial number." Manufacturer *string `json:"manufacturer,omitempty"` // "The manufacturer of the device." Model *string `json:"model,omitempty"` // "The model of the device." Name *string `json:"name,omitempty"` // "The name of the device." SuggestedArea *string `json:"suggested_area,omitempty"` // "Suggest an area if the device isn’t in one yet." SwVersion *string `json:"sw_version,omitempty"` // "The firmware version of the device." ViaDevice *string `json:"via_device,omitempty"` // "Identifier of a device that routes messages between this device and Home Assistant. Examples of such devices are hubs, or parent devices of a sub-device. This is used to show device topology in Home Assistant." } `json:"device,omitempty"` // Device configuration parameters DeviceClass *string `json:"device_class,omitempty"` // "The [type/class](/integrations/switch/#device-class) of the switch to set the icon in the frontend. The `device_class` can be `null`." EnabledByDefault *bool `json:"enabled_by_default,omitempty"` // "Flag which defines if the entity should be enabled when first added." Encoding *string `json:"encoding,omitempty"` // "The encoding of the payloads received and published messages. Set to `\"\"` to disable decoding of incoming payload." EntityCategory *string `json:"entity_category,omitempty"` // "The [category](https://developers.home-assistant.io/docs/core/entity#generic-properties) of the entity." Icon *string `json:"icon,omitempty"` // "[Icon](/docs/configuration/customizing-devices/#icon) for the entity." JsonAttributesTemplate *string `json:"json_attributes_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the JSON dictionary from messages received on the `json_attributes_topic`. Usage example can be found in [MQTT sensor](/integrations/sensor.mqtt/#json-attributes-template-configuration) documentation." JsonAttributesTopic *string `json:"json_attributes_topic,omitempty"` // "The MQTT topic subscribed to receive a JSON dictionary payload and then set as sensor attributes. Usage example can be found in [MQTT sensor](/integrations/sensor.mqtt/#json-attributes-topic-configuration) documentation." JsonAttributesFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for json attributes Name *string `json:"name,omitempty"` // "The name to use when displaying this switch. Can be set to `null` if only the device name is relevant." ObjectId *string `json:"object_id,omitempty"` // "Used instead of `name` for automatic generation of `entity_id`" Optimistic *bool `json:"optimistic,omitempty"` // "Flag that defines if switch works in optimistic mode." PayloadAvailable *string `json:"payload_available,omitempty"` // "The payload that represents the available state." PayloadNotAvailable *string `json:"payload_not_available,omitempty"` // "The payload that represents the unavailable state." PayloadOff *string `json:"payload_off,omitempty"` // "The payload that represents `off` state. If specified, will be used for both comparing to the value in the `state_topic` (see `value_template` and `state_off` for details) and sending as `off` command to the `command_topic`." PayloadOn *string `json:"payload_on,omitempty"` // "The payload that represents `on` state. If specified, will be used for both comparing to the value in the `state_topic` (see `value_template` and `state_on` for details) and sending as `on` command to the `command_topic`." Qos *int `json:"qos,omitempty"` // "The maximum QoS level to be used when receiving and publishing messages." Retain *bool `json:"retain,omitempty"` // "If the published message should have the retain flag on or not." StateOff *string `json:"state_off,omitempty"` // "The payload that represents the `off` state. Used when value that represents `off` state in the `state_topic` is different from value that should be sent to the `command_topic` to turn the device `off`." StateOn *string `json:"state_on,omitempty"` // "The payload that represents the `on` state. Used when value that represents `on` state in the `state_topic` is different from value that should be sent to the `command_topic` to turn the device `on`." StateTopic *string `json:"state_topic,omitempty"` // "The MQTT topic subscribed to receive state updates." StateFunc func() string `json:"-"` // Function for state UniqueId *string `json:"unique_id,omitempty"` // "An ID that uniquely identifies this switch device. If two switches have the same unique ID, Home Assistant will raise an exception." ValueTemplate *string `json:"value_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract device's state from the `state_topic`. To determine the switches's state result of this template will be compared to `state_on` and `state_off`." MQTT *MQTTFields `json:"-"` // MQTT configuration parameters }
////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////
func (*Switch) AddMessageHandler ¶
func (d *Switch) AddMessageHandler()
func (*Switch) AnnounceAvailable ¶
func (d *Switch) AnnounceAvailable()
func (*Switch) GetMQTTFields ¶
func (d *Switch) GetMQTTFields() (fields MQTTFields)
func (*Switch) GetUniqueId ¶
func (*Switch) Initialize ¶
func (d *Switch) Initialize()
func (*Switch) PopulateDevice ¶
func (d *Switch) PopulateDevice()
func (*Switch) PopulateTopics ¶
func (d *Switch) PopulateTopics()
func (*Switch) SetMQTTFields ¶
func (d *Switch) SetMQTTFields(fields MQTTFields)
func (*Switch) UnSubscribe ¶
func (d *Switch) UnSubscribe()
func (*Switch) UpdateState ¶
func (d *Switch) UpdateState()
type Tag ¶
type Tag struct { Device struct { ConfigurationUrl *string `json:"configuration_url,omitempty"` // "A link to the webpage that can manage the configuration of this device. Can be either an `http://`, `https://` or an internal `homeassistant://` URL." Connections *string `json:"connections,omitempty"` // "A list of connections of the device to the outside world as a list of tuples `[connection_type, connection_identifier]`. For example the MAC address of a network interface: `\"connections\": [[\"mac\", \"02:5b:26:a8:dc:12\"]]`." Identifiers *string `json:"identifiers,omitempty"` // "A list of IDs that uniquely identify the device. For example a serial number." Manufacturer *string `json:"manufacturer,omitempty"` // "The manufacturer of the device." Model *string `json:"model,omitempty"` // "The model of the device." Name *string `json:"name,omitempty"` // "The name of the device." SuggestedArea *string `json:"suggested_area,omitempty"` // "Suggest an area if the device isn’t in one yet." SwVersion *string `json:"sw_version,omitempty"` // "The firmware version of the device." ViaDevice *string `json:"via_device,omitempty"` // "Identifier of a device that routes messages between this device and Home Assistant. Examples of such devices are hubs, or parent devices of a sub-device. This is used to show device topology in Home Assistant." } `json:"device,omitempty"` // Device configuration parameters StateTopic *string `json:"topic,omitempty"` // "The MQTT topic subscribed to receive tag scanned events." StateFunc func() string `json:"-"` // Function for state ValueTemplate *string `json:"value_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) that returns a tag ID." MQTT *MQTTFields `json:"-"` // MQTT configuration parameters }
////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////
func (*Tag) AddMessageHandler ¶
func (d *Tag) AddMessageHandler()
func (*Tag) AnnounceAvailable ¶
func (d *Tag) AnnounceAvailable()
func (*Tag) GetMQTTFields ¶
func (d *Tag) GetMQTTFields() (fields MQTTFields)
func (Tag) GetUniqueId ¶
func (*Tag) Initialize ¶
func (d *Tag) Initialize()
func (*Tag) PopulateDevice ¶
func (d *Tag) PopulateDevice()
func (*Tag) PopulateTopics ¶
func (d *Tag) PopulateTopics()
func (*Tag) SetMQTTFields ¶
func (d *Tag) SetMQTTFields(fields MQTTFields)
func (*Tag) UnSubscribe ¶
func (d *Tag) UnSubscribe()
func (*Tag) UpdateState ¶
func (d *Tag) UpdateState()
type Text ¶
type Text struct { AvailabilityMode *string `json:"availability_mode,omitempty"` // "When `availability` is configured, this controls the conditions needed to set the entity to `available`. Valid entries are `all`, `any`, and `latest`. If set to `all`, `payload_available` must be received on all configured availability topics before the entity is marked as online. If set to `any`, `payload_available` must be received on at least one configured availability topic before the entity is marked as online. If set to `latest`, the last `payload_available` or `payload_not_available` received on any configured availability topic controls the availability." AvailabilityTemplate *string `json:"availability_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract device's availability from the `availability_topic`. To determine the devices's availability result of this template will be compared to `payload_available` and `payload_not_available`." AvailabilityTopic *string `json:"availability_topic,omitempty"` // "The MQTT topic subscribed to receive availability (online/offline) updates. Must not be used together with `availability`." AvailabilityFunc func() string `json:"-"` // Function for availability CommandTemplate *string `json:"command_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to generate the payload to send to `command_topic`." CommandTopic *string `json:"command_topic,omitempty"` // "The MQTT topic to publish the text value that is set." CommandFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for command Device struct { ConfigurationUrl *string `json:"configuration_url,omitempty"` // "A link to the webpage that can manage the configuration of this device. Can be either an `http://`, `https://` or an internal `homeassistant://` URL." Connections *string `json:"connections,omitempty"` // "A list of connections of the device to the outside world as a list of tuples `[connection_type, connection_identifier]`. For example the MAC address of a network interface: `\"connections\": [[\"mac\", \"02:5b:26:a8:dc:12\"]]`." Identifiers *string `json:"identifiers,omitempty"` // "A list of IDs that uniquely identify the device. For example a serial number." Manufacturer *string `json:"manufacturer,omitempty"` // "The manufacturer of the device." Model *string `json:"model,omitempty"` // "The model of the device." Name *string `json:"name,omitempty"` // "The name of the device." SuggestedArea *string `json:"suggested_area,omitempty"` // "Suggest an area if the device isn’t in one yet." SwVersion *string `json:"sw_version,omitempty"` // "The firmware version of the device." ViaDevice *string `json:"via_device,omitempty"` // "Identifier of a device that routes messages between this device and Home Assistant. Examples of such devices are hubs, or parent devices of a sub-device. This is used to show device topology in Home Assistant." } `json:"device,omitempty"` // Device configuration parameters EnabledByDefault *bool `json:"enabled_by_default,omitempty"` // "Flag which defines if the entity should be enabled when first added." Encoding *string `json:"encoding,omitempty"` // "The encoding of the payloads received and published messages. Set to `\"\"` to disable decoding of incoming payload." EntityCategory *string `json:"entity_category,omitempty"` // "The [category](https://developers.home-assistant.io/docs/core/entity#generic-properties) of the entity." JsonAttributesTemplate *string `json:"json_attributes_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the JSON dictionary from messages received on the `json_attributes_topic`." JsonAttributesTopic *string `json:"json_attributes_topic,omitempty"` // "The MQTT topic subscribed to receive a JSON dictionary payload and then set as entity attributes. Implies `force_update` of the current select state when a message is received on this topic." JsonAttributesFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for json attributes Max *int `json:"max,omitempty"` // "The maximum size of a text being set or received (maximum is 255)." Min *int `json:"min,omitempty"` // "The minimum size of a text being set or received." Mode *string `json:"mode,omitempty"` // "The mode off the text entity. Must be either `text` or `password`." Name *string `json:"name,omitempty"` // "The name of the text entity. Can be set to `null` if only the device name is relevant." ObjectId *string `json:"object_id,omitempty"` // "Used instead of `name` for automatic generation of `entity_id`" Pattern *string `json:"pattern,omitempty"` // "A valid regular expression the text being set or received must match with." Qos *int `json:"qos,omitempty"` // "The maximum QoS level to be used when receiving and publishing messages." Retain *bool `json:"retain,omitempty"` // "If the published message should have the retain flag on or not." StateTopic *string `json:"state_topic,omitempty"` // "The MQTT topic subscribed to receive text state updates. Text state updates should match the `pattern` (if set) and meet the size constraints `min` and `max`. Can be used with `value_template` to render the incoming payload to a text update." StateFunc func() string `json:"-"` // Function for state UniqueId *string `json:"unique_id,omitempty"` // "An ID that uniquely identifies this Select. If two Selects have the same unique ID Home Assistant will raise an exception." ValueTemplate *string `json:"value_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the text state value from the payload received on `state_topic`." MQTT *MQTTFields `json:"-"` // MQTT configuration parameters }
////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////
func (*Text) AddMessageHandler ¶
func (d *Text) AddMessageHandler()
func (*Text) AnnounceAvailable ¶
func (d *Text) AnnounceAvailable()
func (*Text) GetMQTTFields ¶
func (d *Text) GetMQTTFields() (fields MQTTFields)
func (*Text) GetUniqueId ¶
func (*Text) Initialize ¶
func (d *Text) Initialize()
func (*Text) PopulateDevice ¶
func (d *Text) PopulateDevice()
func (*Text) PopulateTopics ¶
func (d *Text) PopulateTopics()
func (*Text) SetMQTTFields ¶
func (d *Text) SetMQTTFields(fields MQTTFields)
func (*Text) UnSubscribe ¶
func (d *Text) UnSubscribe()
func (*Text) UpdateState ¶
func (d *Text) UpdateState()
type Update ¶
type Update struct { AvailabilityMode *string `json:"availability_mode,omitempty"` // "When `availability` is configured, this controls the conditions needed to set the entity to `available`. Valid entries are `all`, `any`, and `latest`. If set to `all`, `payload_available` must be received on all configured availability topics before the entity is marked as online. If set to `any`, `payload_available` must be received on at least one configured availability topic before the entity is marked as online. If set to `latest`, the last `payload_available` or `payload_not_available` received on any configured availability topic controls the availability." AvailabilityTemplate *string `json:"availability_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract device's availability from the `availability_topic`. To determine the devices's availability result of this template will be compared to `payload_available` and `payload_not_available`." AvailabilityTopic *string `json:"availability_topic,omitempty"` // "The MQTT topic subscribed to receive availability (online/offline) updates. Must not be used together with `availability`." AvailabilityFunc func() string `json:"-"` // Function for availability CommandTopic *string `json:"command_topic,omitempty"` // "The MQTT topic to publish `payload_install` to start installing process." CommandFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for command Device struct { ConfigurationUrl *string `json:"configuration_url,omitempty"` // "A link to the webpage that can manage the configuration of this device. Can be either an `http://`, `https://` or an internal `homeassistant://` URL." Connections *string `json:"connections,omitempty"` // "A list of connections of the device to the outside world as a list of tuples `[connection_type, connection_identifier]`. For example the MAC address of a network interface: `\"connections\": [[\"mac\", \"02:5b:26:a8:dc:12\"]]`." Identifiers *string `json:"identifiers,omitempty"` // "A list of IDs that uniquely identify the device. For example a serial number." Manufacturer *string `json:"manufacturer,omitempty"` // "The manufacturer of the device." Model *string `json:"model,omitempty"` // "The model of the device." Name *string `json:"name,omitempty"` // "The name of the device." SuggestedArea *string `json:"suggested_area,omitempty"` // "Suggest an area if the device isn’t in one yet." SwVersion *string `json:"sw_version,omitempty"` // "The firmware version of the device." ViaDevice *string `json:"via_device,omitempty"` // "Identifier of a device that routes messages between this device and Home Assistant. Examples of such devices are hubs, or parent devices of a sub-device. This is used to show device topology in Home Assistant." } `json:"device,omitempty"` // Device configuration parameters DeviceClass *string `json:"device_class,omitempty"` // "The [type/class](/integrations/update/#device-classes) of the update to set the icon in the frontend. The `device_class` can be `null`." EnabledByDefault *bool `json:"enabled_by_default,omitempty"` // "Flag which defines if the entity should be enabled when first added." Encoding *string `json:"encoding,omitempty"` // "The encoding of the payloads received and published messages. Set to `\"\"` to disable decoding of incoming payload." EntityCategory *string `json:"entity_category,omitempty"` // "The [category](https://developers.home-assistant.io/docs/core/entity#generic-properties) of the entity." EntityPicture *string `json:"entity_picture,omitempty"` // "Picture URL for the entity." Icon *string `json:"icon,omitempty"` // "[Icon](/docs/configuration/customizing-devices/#icon) for the entity." JsonAttributesTemplate *string `json:"json_attributes_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the JSON dictionary from messages received on the `json_attributes_topic`." JsonAttributesTopic *string `json:"json_attributes_topic,omitempty"` // "The MQTT topic subscribed to receive a JSON dictionary payload and then set as entity attributes. Implies `force_update` of the current select state when a message is received on this topic." JsonAttributesFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for json attributes LatestVersionTemplate *string `json:"latest_version_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the latest version value." LatestVersionTopic *string `json:"latest_version_topic,omitempty"` // "The MQTT topic subscribed to receive an update of the latest version." LatestVersionFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for latest version Name *string `json:"name,omitempty"` // "The name of the Update. Can be set to `null` if only the device name is relevant." ObjectId *string `json:"object_id,omitempty"` // "Used instead of `name` for automatic generation of `entity_id`" PayloadInstall *string `json:"payload_install,omitempty"` // "The MQTT payload to start installing process." Qos *int `json:"qos,omitempty"` // "The maximum QoS level to be used when receiving and publishing messages." ReleaseSummary *string `json:"release_summary,omitempty"` // "Summary of the release notes or changelog. This is suitable a brief update description of max 255 characters." ReleaseUrl *string `json:"release_url,omitempty"` // "URL to the full release notes of the latest version available." Retain *bool `json:"retain,omitempty"` // "If the published message should have the retain flag on or not." StateTopic *string `json:"state_topic,omitempty"` // "The MQTT topic subscribed to receive state updates. The state update may be either JSON or a simple string with `installed_version` value. When a JSON payload is detected, the state value of the JSON payload should supply the `installed_version` and can optional supply: `latest_version`, `title`, `release_summary`, `release_url` or an `entity_picture` URL." StateFunc func() string `json:"-"` // Function for state Title *string `json:"title,omitempty"` // "Title of the software, or firmware update. This helps to differentiate between the device or entity name versus the title of the software installed." UniqueId *string `json:"unique_id,omitempty"` // "An ID that uniquely identifies this Update. If two Updates have the same unique ID Home Assistant will raise an exception." ValueTemplate *string `json:"value_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the `installed_version` state value or to render to a valid JSON payload on from the payload received on `state_topic`." MQTT *MQTTFields `json:"-"` // MQTT configuration parameters }
////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////
func (*Update) AddMessageHandler ¶
func (d *Update) AddMessageHandler()
func (*Update) AnnounceAvailable ¶
func (d *Update) AnnounceAvailable()
func (*Update) GetMQTTFields ¶
func (d *Update) GetMQTTFields() (fields MQTTFields)
func (*Update) GetUniqueId ¶
func (*Update) Initialize ¶
func (d *Update) Initialize()
func (*Update) PopulateDevice ¶
func (d *Update) PopulateDevice()
func (*Update) PopulateTopics ¶
func (d *Update) PopulateTopics()
func (*Update) SetMQTTFields ¶
func (d *Update) SetMQTTFields(fields MQTTFields)
func (*Update) UnSubscribe ¶
func (d *Update) UnSubscribe()
func (*Update) UpdateState ¶
func (d *Update) UpdateState()
type Vacuum ¶
type Vacuum struct { AvailabilityMode *string `json:"availability_mode,omitempty"` // "When `availability` is configured, this controls the conditions needed to set the entity to `available`. Valid entries are `all`, `any`, and `latest`. If set to `all`, `payload_available` must be received on all configured availability topics before the entity is marked as online. If set to `any`, `payload_available` must be received on at least one configured availability topic before the entity is marked as online. If set to `latest`, the last `payload_available` or `payload_not_available` received on any configured availability topic controls the availability." AvailabilityTemplate *string `json:"availability_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract device's availability from the `availability_topic`. To determine the devices's availability result of this template will be compared to `payload_available` and `payload_not_available`." AvailabilityTopic *string `json:"availability_topic,omitempty"` // "The MQTT topic subscribed to receive availability (online/offline) updates. Must not be used together with `availability`." AvailabilityFunc func() string `json:"-"` // Function for availability CommandTopic *string `json:"command_topic,omitempty"` // "The MQTT topic to publish commands to control the vacuum." CommandFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for command Device struct { ConfigurationUrl *string `json:"configuration_url,omitempty"` // "A link to the webpage that can manage the configuration of this device. Can be either an `http://`, `https://` or an internal `homeassistant://` URL." Connections *string `json:"connections,omitempty"` // "A list of connections of the device to the outside world as a list of tuples `[connection_type, connection_identifier]`. For example the MAC address of a network interface: `\"connections\": [[\"mac\", \"02:5b:26:a8:dc:12\"]]`." Identifiers *string `json:"identifiers,omitempty"` // "A list of IDs that uniquely identify the device. For example a serial number." Manufacturer *string `json:"manufacturer,omitempty"` // "The manufacturer of the device." Model *string `json:"model,omitempty"` // "The model of the device." Name *string `json:"name,omitempty"` // "The name of the device." SuggestedArea *string `json:"suggested_area,omitempty"` // "Suggest an area if the device isn’t in one yet." SwVersion *string `json:"sw_version,omitempty"` // "The firmware version of the device." ViaDevice *string `json:"via_device,omitempty"` // "Identifier of a device that routes messages between this device and Home Assistant. Examples of such devices are hubs, or parent devices of a sub-device. This is used to show device topology in Home Assistant." } `json:"device,omitempty"` // Device configuration parameters Encoding *string `json:"encoding,omitempty"` // "The encoding of the payloads received and published messages. Set to `\"\"` to disable decoding of incoming payload." FanSpeedList *([]string) `json:"fan_speed_list,omitempty"` // "List of possible fan speeds for the vacuum." JsonAttributesTemplate *string `json:"json_attributes_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the JSON dictionary from messages received on the `json_attributes_topic`. Usage example can be found in [MQTT sensor](/integrations/sensor.mqtt/#json-attributes-template-configuration) documentation." JsonAttributesTopic *string `json:"json_attributes_topic,omitempty"` // "The MQTT topic subscribed to receive a JSON dictionary payload and then set as sensor attributes. Usage example can be found in [MQTT sensor](/integrations/sensor.mqtt/#json-attributes-topic-configuration) documentation." JsonAttributesFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for json attributes Name *string `json:"name,omitempty"` // "The name of the vacuum. Can be set to `null` if only the device name is relevant." ObjectId *string `json:"object_id,omitempty"` // "Used instead of `name` for automatic generation of `entity_id`" PayloadAvailable *string `json:"payload_available,omitempty"` // "The payload that represents the available state." PayloadCleanSpot *string `json:"payload_clean_spot,omitempty"` // "The payload to send to the `command_topic` to begin a spot cleaning cycle." PayloadLocate *string `json:"payload_locate,omitempty"` // "The payload to send to the `command_topic` to locate the vacuum (typically plays a song)." PayloadNotAvailable *string `json:"payload_not_available,omitempty"` // "The payload that represents the unavailable state." PayloadPause *string `json:"payload_pause,omitempty"` // "The payload to send to the `command_topic` to pause the vacuum." PayloadReturnToBase *string `json:"payload_return_to_base,omitempty"` // "The payload to send to the `command_topic` to tell the vacuum to return to base." PayloadStart *string `json:"payload_start,omitempty"` // "The payload to send to the `command_topic` to begin the cleaning cycle." PayloadStop *string `json:"payload_stop,omitempty"` // "The payload to send to the `command_topic` to stop cleaning." Qos *int `json:"qos,omitempty"` // "The maximum QoS level to be used when receiving and publishing messages." Retain *bool `json:"retain,omitempty"` // "If the published message should have the retain flag on or not." SendCommandTopic *string `json:"send_command_topic,omitempty"` // "The MQTT topic to publish custom commands to the vacuum." SendCommandFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for send command SetFanSpeedTopic *string `json:"set_fan_speed_topic,omitempty"` // "The MQTT topic to publish commands to control the vacuum's fan speed." SetFanSpeedFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for set fan speed StateTopic *string `json:"state_topic,omitempty"` // "The MQTT topic subscribed to receive state messages from the vacuum. Messages received on the `state_topic` must be a valid JSON dictionary, with a mandatory `state` key and optionally `battery_level` and `fan_speed` keys as shown in the [example](#configuration-example)." StateFunc func() string `json:"-"` // Function for state SupportedFeatures *([]string) `json:"supported_features,omitempty"` // "List of features that the vacuum supports (possible values are `start`, `stop`, `pause`, `return_home`, `battery`, `status`, `locate`, `clean_spot`, `fan_speed`, `send_command`)." UniqueId *string `json:"unique_id,omitempty"` // "An ID that uniquely identifies this vacuum. If two vacuums have the same unique ID, Home Assistant will raise an exception." MQTT *MQTTFields `json:"-"` // MQTT configuration parameters }
////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////
func (*Vacuum) AddMessageHandler ¶
func (d *Vacuum) AddMessageHandler()
func (*Vacuum) AnnounceAvailable ¶
func (d *Vacuum) AnnounceAvailable()
func (*Vacuum) GetMQTTFields ¶
func (d *Vacuum) GetMQTTFields() (fields MQTTFields)
func (*Vacuum) GetUniqueId ¶
func (*Vacuum) Initialize ¶
func (d *Vacuum) Initialize()
func (*Vacuum) PopulateDevice ¶
func (d *Vacuum) PopulateDevice()
func (*Vacuum) PopulateTopics ¶
func (d *Vacuum) PopulateTopics()
func (*Vacuum) SetMQTTFields ¶
func (d *Vacuum) SetMQTTFields(fields MQTTFields)
func (*Vacuum) UnSubscribe ¶
func (d *Vacuum) UnSubscribe()
func (*Vacuum) UpdateState ¶
func (d *Vacuum) UpdateState()
type Valve ¶
type Valve struct { AvailabilityMode *string `json:"availability_mode,omitempty"` // "When `availability` is configured, this controls the conditions needed to set the entity to `available`. Valid entries are `all`, `any`, and `latest`. If set to `all`, `payload_available` must be received on all configured availability topics before the entity is marked as online. If set to `any`, `payload_available` must be received on at least one configured availability topic before the entity is marked as online. If set to `latest`, the last `payload_available` or `payload_not_available` received on any configured availability topic controls the availability." AvailabilityTemplate *string `json:"availability_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the device's availability from the `availability_topic`. To determine the devices's availability, the result of this template will be compared to `payload_available` and `payload_not_available`." AvailabilityTopic *string `json:"availability_topic,omitempty"` // "The MQTT topic subscribed to receive birth and LWT messages from the MQTT valve device. If an `availability` topic is not defined, the valve availability state will always be `available`. If an `availability` topic is defined, the valve availability state will be `unavailable` by default. Must not be used together with `availability`." AvailabilityFunc func() string `json:"-"` // Function for availability CommandTemplate *string `json:"command_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to generate the payload to send to `command_topic`." CommandTopic *string `json:"command_topic,omitempty"` // "The MQTT topic to publish commands to control the valve. The value sent can be a value defined by `payload_open`, `payload_close` or `payload_stop`. If `reports_position` is set to `true`, a numeric value will be published instead." CommandFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for command Device struct { ConfigurationUrl *string `json:"configuration_url,omitempty"` // "A link to the webpage that can manage the configuration of this device. Can be either an `http://`, `https://` or an internal `homeassistant://` URL." Connections *string `json:"connections,omitempty"` // "A list of connections of the device to the outside world as a list of tuples `[connection_type, connection_identifier]`. For example, the MAC address of a network interface: `\"connections\": [[\"mac\", \"02:5b:26:a8:dc:12\"]]`." Identifiers *string `json:"identifiers,omitempty"` // "A list of IDs that uniquely identify the device. For example, a serial number." Manufacturer *string `json:"manufacturer,omitempty"` // "The manufacturer of the device." Model *string `json:"model,omitempty"` // "The model of the device." Name *string `json:"name,omitempty"` // "The name of the device." SuggestedArea *string `json:"suggested_area,omitempty"` // "Suggest an area if the device isn’t in one yet." SwVersion *string `json:"sw_version,omitempty"` // "The firmware version of the device." ViaDevice *string `json:"via_device,omitempty"` // "Identifier of a device that routes messages between this device and Home Assistant. Examples of such devices are hubs, or parent devices of a sub-device. This is used to show device topology in Home Assistant." } `json:"device,omitempty"` // Device configuration parameters DeviceClass *string `json:"device_class,omitempty"` // "Sets the [class of the device](/integrations/valve/), changing the device state and icon that is displayed on the frontend. The `device_class` can be `null`." EnabledByDefault *bool `json:"enabled_by_default,omitempty"` // "Flag which defines if the entity should be enabled when first added." Encoding *string `json:"encoding,omitempty"` // "The encoding of the payloads received and published messages. Set to `\"\"` to disable decoding of incoming payload." EntityCategory *string `json:"entity_category,omitempty"` // "The [category](https://developers.home-assistant.io/docs/core/entity#generic-properties) of the entity." Icon *string `json:"icon,omitempty"` // "[Icon](/docs/configuration/customizing-devices/#icon) for the entity." JsonAttributesTemplate *string `json:"json_attributes_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the JSON dictionary from messages received on the `json_attributes_topic`. A usage example can be found in the [MQTT sensor](/integrations/sensor.mqtt/#json-attributes-template-configuration) documentation." JsonAttributesTopic *string `json:"json_attributes_topic,omitempty"` // "The MQTT topic subscribed to receive a JSON dictionary payload and then set as sensor attributes. A usage example can be found in [MQTT sensor](/integrations/sensor.mqtt/#json-attributes-topic-configuration) documentation." JsonAttributesFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for json attributes Name *string `json:"name,omitempty"` // "The name of the valve. Can be set to `null` if only the device name is relevant." ObjectId *string `json:"object_id,omitempty"` // "Used instead of `name` to have the `entity_id` generated automatically." Optimistic *bool `json:"optimistic,omitempty"` // "Flag that defines if a switch works in optimistic mode." PayloadAvailable *string `json:"payload_available,omitempty"` // "The payload that represents the online state." PayloadClose *string `json:"payload_close,omitempty"` // "The command payload that closes the valve. Is only used when `reports_position` is set to `false` (default). The `payload_close` is not allowed if `reports_position` is set to `true`. Can be set to `null` to disable the valve's close option." PayloadNotAvailable *string `json:"payload_not_available,omitempty"` // "The payload that represents the offline state." PayloadOpen *string `json:"payload_open,omitempty"` // "The command payload that opens the valve. Is only used when `reports_position` is set to `false` (default). The `payload_open` is not allowed if `reports_position` is set to `true`. Can be set to `null` to disable the valve's open option." PayloadStop *string `json:"payload_stop,omitempty"` // "The command payload that stops the valve. When not configured, the valve will not support the `valve.stop` service." PositionClosed *int `json:"position_closed,omitempty"` // "Number which represents closed position. The valve's position will be scaled to the(`position_closed`...`position_open`) range when a service is called and scaled back when a value is received." PositionOpen *int `json:"position_open,omitempty"` // "Number which represents open position. The valve's position will be scaled to (`position_closed`...`position_open`) range when a service is called and scaled back when a value is received." Qos *int `json:"qos,omitempty"` // "The maximum QoS level to be used when receiving and publishing messages." ReportsPosition *bool `json:"reports_position,omitempty"` // "Set to `true` if the value reports the position or supports setting the position. Enabling the `reports_position` option will cause the position to be published instead of a payload defined by `payload_open`, `payload_close` or `payload_stop`. When receiving messages, `state_topic` will accept numeric payloads or one of the following state messages: `open`, `opening`, `closed`, or `closing`." Retain *bool `json:"retain,omitempty"` // "Defines if published messages should have the retain flag set." StateClosed *string `json:"state_closed,omitempty"` // "The payload that represents the closed state. Is only allowed when `reports_position` is set to `False` (default)." StateClosing *string `json:"state_closing,omitempty"` // "The payload that represents the closing state." StateOpen *string `json:"state_open,omitempty"` // "The payload that represents the open state. Is only allowed when `reports_position` is set to `False` (default)." StateOpening *string `json:"state_opening,omitempty"` // "The payload that represents the opening state." StateTopic *string `json:"state_topic,omitempty"` // "The MQTT topic subscribed to receive valve state messages. State topic accepts a state payload (`open`, `opening`, `closed`, or `closing`) or, if `reports_position` is supported, a numeric value representing the position. In a JSON format with variables `state` and `position` both values can received together." StateFunc func() string `json:"-"` // Function for state UniqueId *string `json:"unique_id,omitempty"` // "An ID that uniquely identifies this valve. If two valves have the same unique ID, Home Assistant will raise an exception." ValueTemplate *string `json:"value_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) that can be used to extract the payload for the `state_topic` topic. The rendered value should be a defined state payload or, if reporting a `position` is supported and `reports_position` is set to `true`, a numeric value is expected representing the position. See also `state_topic`." MQTT *MQTTFields `json:"-"` // MQTT configuration parameters }
////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////
func (*Valve) AddMessageHandler ¶
func (d *Valve) AddMessageHandler()
func (*Valve) AnnounceAvailable ¶
func (d *Valve) AnnounceAvailable()
func (*Valve) GetMQTTFields ¶
func (d *Valve) GetMQTTFields() (fields MQTTFields)
func (*Valve) GetUniqueId ¶
func (*Valve) Initialize ¶
func (d *Valve) Initialize()
func (*Valve) PopulateDevice ¶
func (d *Valve) PopulateDevice()
func (*Valve) PopulateTopics ¶
func (d *Valve) PopulateTopics()
func (*Valve) SetMQTTFields ¶
func (d *Valve) SetMQTTFields(fields MQTTFields)
func (*Valve) UnSubscribe ¶
func (d *Valve) UnSubscribe()
func (*Valve) UpdateState ¶
func (d *Valve) UpdateState()
type WaterHeater ¶
type WaterHeater struct { AvailabilityMode *string `json:"availability_mode,omitempty"` // "When `availability` is configured, this controls the conditions needed to set the entity to `available`. Valid entries are `all`, `any`, and `latest`. If set to `all`, `payload_available` must be received on all configured availability topics before the entity is marked as online. If set to `any`, `payload_available` must be received on at least one configured availability topic before the entity is marked as online. If set to `latest`, the last `payload_available` or `payload_not_available` received on any configured availability topic controls the availability." AvailabilityTemplate *string `json:"availability_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract device's availability from the `availability_topic`. To determine the devices's availability result of this template will be compared to `payload_available` and `payload_not_available`." AvailabilityTopic *string `json:"availability_topic,omitempty"` // "The MQTT topic subscribed to receive availability (online/offline) updates. Must not be used together with `availability`." AvailabilityFunc func() string `json:"-"` // Function for availability CurrentTemperatureTemplate *string `json:"current_temperature_template,omitempty"` // "A template with which the value received on `current_temperature_topic` will be rendered." CurrentTemperatureTopic *string `json:"current_temperature_topic,omitempty"` // "The MQTT topic on which to listen for the current temperature. A `\"None\"` value received will reset the current temperature. Empty values (`”'`) will be ignored." CurrentTemperatureFunc func() string `json:"-"` // Function for current temperature Device struct { ConfigurationUrl *string `json:"configuration_url,omitempty"` // "A link to the webpage that can manage the configuration of this device. Can be either an `http://`, `https://` or an internal `homeassistant://` URL." Connections *string `json:"connections,omitempty"` // "A list of connections of the device to the outside world as a list of tuples `[connection_type, connection_identifier]`. For example the MAC address of a network interface: `\"connections\": [[\"mac\", \"02:5b:26:a8:dc:12\"]]`." Identifiers *string `json:"identifiers,omitempty"` // "A list of IDs that uniquely identify the device. For example a serial number." Manufacturer *string `json:"manufacturer,omitempty"` // "The manufacturer of the device." Model *string `json:"model,omitempty"` // "The model of the device." Name *string `json:"name,omitempty"` // "The name of the device." SuggestedArea *string `json:"suggested_area,omitempty"` // "Suggest an area if the device isn’t in one yet." SwVersion *string `json:"sw_version,omitempty"` // "The firmware version of the device." ViaDevice *string `json:"via_device,omitempty"` // "Identifier of a device that routes messages between this device and Home Assistant. Examples of such devices are hubs, or parent devices of a sub-device. This is used to show device topology in Home Assistant." } `json:"device,omitempty"` // Device configuration parameters EnabledByDefault *bool `json:"enabled_by_default,omitempty"` // "Flag which defines if the entity should be enabled when first added." Encoding *string `json:"encoding,omitempty"` // "The encoding of the payloads received and published messages. Set to `\"\"` to disable decoding of incoming payload." EntityCategory *string `json:"entity_category,omitempty"` // "The [category](https://developers.home-assistant.io/docs/core/entity#generic-properties) of the entity." Icon *string `json:"icon,omitempty"` // "[Icon](/docs/configuration/customizing-devices/#icon) for the entity." Initial *int `json:"initial,omitempty"` // "Set the initial target temperature. The default value depends on the temperature unit, and will be 43.3°C or 110°F." JsonAttributesTemplate *string `json:"json_attributes_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the JSON dictionary from messages received on the `json_attributes_topic`. Usage example can be found in [MQTT sensor](/integrations/sensor.mqtt/#json-attributes-template-configuration) documentation." JsonAttributesTopic *string `json:"json_attributes_topic,omitempty"` // "The MQTT topic subscribed to receive a JSON dictionary payload and then set as sensor attributes. Usage example can be found in [MQTT sensor](/integrations/sensor.mqtt/#json-attributes-topic-configuration) documentation." JsonAttributesFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for json attributes MaxTemp *float64 `json:"max_temp,omitempty"` // "Maximum set point available. The default value depends on the temperature unit, and will be 60°C or 140°F." MinTemp *float64 `json:"min_temp,omitempty"` // "Minimum set point available. The default value depends on the temperature unit, and will be 43.3°C or 110°F." ModeCommandTemplate *string `json:"mode_command_template,omitempty"` // "A template to render the value sent to the `mode_command_topic` with." ModeCommandTopic *string `json:"mode_command_topic,omitempty"` // "The MQTT topic to publish commands to change the water heater operation mode." ModeCommandFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for mode command ModeStateTemplate *string `json:"mode_state_template,omitempty"` // "A template to render the value received on the `mode_state_topic` with." ModeStateTopic *string `json:"mode_state_topic,omitempty"` // "The MQTT topic to subscribe for changes of the water heater operation mode. If this is not set, the operation mode works in optimistic mode (see below)." ModeStateFunc func() string `json:"-"` // Function for mode state Modes *([]string) `json:"modes,omitempty"` // "A list of supported modes. Needs to be a subset of the default values." Name *string `json:"name,omitempty"` // "The name of the water heater. Can be set to `null` if only the device name is relevant." ObjectId *string `json:"object_id,omitempty"` // "Used instead of `name` for automatic generation of `entity_id`" Optimistic *bool `json:"optimistic,omitempty"` // "Flag that defines if the water heater works in optimistic mode" PayloadAvailable *string `json:"payload_available,omitempty"` // "The payload that represents the available state." PayloadNotAvailable *string `json:"payload_not_available,omitempty"` // "The payload that represents the unavailable state." PayloadOff *string `json:"payload_off,omitempty"` // "The payload that represents disabled state." PayloadOn *string `json:"payload_on,omitempty"` // "The payload that represents enabled state." PowerCommandTemplate *string `json:"power_command_template,omitempty"` // "A template to render the value sent to the `power_command_topic` with. The `value` parameter is the payload set for `payload_on` or `payload_off`." PowerCommandTopic *string `json:"power_command_topic,omitempty"` // "The MQTT topic to publish commands to change the water heater power state. Sends the payload configured with `payload_on` if the water heater is turned on via the `water_heater.turn_on`, or the payload configured with `payload_off` if the water heater is turned off via the `water_heater.turn_off` service. Note that `optimistic` mode is not supported through `water_heater.turn_on` and `water_heater.turn_off` services. When called, these services will send a power command to the device but will not optimistically update the state of the water heater. The water heater device should report its state back via `mode_state_topic`." PowerCommandFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for power command Precision *float64 `json:"precision,omitempty"` // "The desired precision for this device. Can be used to match your actual water heater's precision. Supported values are `0.1`, `0.5` and `1.0`." Qos *int `json:"qos,omitempty"` // "The maximum QoS level to be used when receiving and publishing messages." Retain *bool `json:"retain,omitempty"` // "Defines if published messages should have the retain flag set." TemperatureCommandTemplate *string `json:"temperature_command_template,omitempty"` // "A template to render the value sent to the `temperature_command_topic` with." TemperatureCommandTopic *string `json:"temperature_command_topic,omitempty"` // "The MQTT topic to publish commands to change the target temperature." TemperatureCommandFunc func(mqtt.Message, mqtt.Client) `json:"-"` // Function for temperature command TemperatureStateTemplate *string `json:"temperature_state_template,omitempty"` // "A template to render the value received on the `temperature_state_topic` with." TemperatureStateTopic *string `json:"temperature_state_topic,omitempty"` // "The MQTT topic to subscribe for changes in the target temperature. If this is not set, the target temperature works in optimistic mode (see below). A `\"None\"` value received will reset the temperature set point. Empty values (`”'`) will be ignored." TemperatureStateFunc func() string `json:"-"` // Function for temperature state TemperatureUnit *string `json:"temperature_unit,omitempty"` // "Defines the temperature unit of the device, `C` or `F`. If this is not set, the temperature unit is set to the system temperature unit." UniqueId *string `json:"unique_id,omitempty"` // "An ID that uniquely identifies this water heater device. If two water heater devices have the same unique ID, Home Assistant will raise an exception." ValueTemplate *string `json:"value_template,omitempty"` // "Default template to render the payloads on *all* `*_state_topic`s with." MQTT *MQTTFields `json:"-"` // MQTT configuration parameters }
////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////
func (*WaterHeater) AddMessageHandler ¶
func (d *WaterHeater) AddMessageHandler()
func (*WaterHeater) AnnounceAvailable ¶
func (d *WaterHeater) AnnounceAvailable()
func (*WaterHeater) GetMQTTFields ¶
func (d *WaterHeater) GetMQTTFields() (fields MQTTFields)
func (*WaterHeater) GetRawId ¶
func (d *WaterHeater) GetRawId() string
func (*WaterHeater) GetUniqueId ¶
func (d *WaterHeater) GetUniqueId() string
func (*WaterHeater) Initialize ¶
func (d *WaterHeater) Initialize()
func (*WaterHeater) PopulateDevice ¶
func (d *WaterHeater) PopulateDevice()
func (*WaterHeater) PopulateTopics ¶
func (d *WaterHeater) PopulateTopics()
func (*WaterHeater) SetMQTTFields ¶
func (d *WaterHeater) SetMQTTFields(fields MQTTFields)
func (*WaterHeater) Subscribe ¶
func (d *WaterHeater) Subscribe()
func (*WaterHeater) UnSubscribe ¶
func (d *WaterHeater) UnSubscribe()
func (*WaterHeater) UpdateState ¶
func (d *WaterHeater) UpdateState()
Source Files ¶
- alarm_control_panel.go
- binary_sensor.go
- button.go
- camera.go
- climate.go
- cover.go
- device_tracker.go
- device_trigger.go
- event.go
- fan.go
- generics.go
- hadiscovery.go
- humidifier.go
- image.go
- lawn_mower.go
- light.go
- lock.go
- number.go
- scene.go
- select.go
- sensor.go
- siren.go
- store.go
- switch.go
- tag.go
- text.go
- types.go
- update.go
- vacuum.go
- valve.go
- water_heater.go