Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions cmdHassio/alarm_control_panel.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ func (m *Mqtt) AlarmControlPanelPublishConfig(config EntityConfig) error {
// StateTopic: JoinStringsForTopic(m.switchPrefix, id, "state"),
CommandTopic: String(JoinStringsForTopic(m.Prefix, LabelAlarmControlPanel, m.ClientId, id, "cmd")),
ObjectId: String(id),
DefaultEntityID: String(id),
UniqueId: String(id),
Qos: 0,
Retain: true,
Expand Down Expand Up @@ -157,6 +158,9 @@ type AlarmControlPanel struct {
// Used instead of name for automatic generation of entity_id
ObjectId String `json:"object_id,omitempty"`

// Alternate for ObjectId required by Home Assistant
DefaultEntityID String `json:"default_entity_id,omitempty"`

// The payload to set armed-away mode on your Alarm Panel.
PayloadArmAway String `json:"payload_arm_away,omitempty" default:"ARM_AWAY"`

Expand Down
3 changes: 3 additions & 0 deletions cmdHassio/alarm_control_panel.txt
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ The name of the alarm.
object_id string (optional)
Used instead of name for automatic generation of entity_id

default_entity_id string (optional)
Used instead of name for automatic generation of entity_id - alternate for homeassistant

payload_arm_away string (optional, default: ARM_AWAY)
The payload to set armed-away mode on your Alarm Panel.

Expand Down
4 changes: 4 additions & 0 deletions cmdHassio/binary_sensor.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ func (m *Mqtt) BinarySensorPublishConfig(config EntityConfig) error {
StateTopic: String(JoinStringsForTopic(m.Prefix, LabelBinarySensor, m.ClientId, id, "state")),
// StateClass: config.StateClass,
ObjectId: String(id),
DefaultEntityID: String(id),
UniqueId: String(id),
// UnitOfMeasurement: config.Units,
DeviceClass: DeviceClass(config.DeviceClass),
Expand Down Expand Up @@ -179,6 +180,9 @@ type BinarySensor struct {
// Used instead of name for automatic generation of entity_id
ObjectId String `json:"object_id,omitempty"`

// Alternate for ObjectId required by Home Assistant
DefaultEntityID String `json:"default_entity_id,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.
OffDelay Integer `json:"off_delay,omitempty"`

Expand Down
3 changes: 3 additions & 0 deletions cmdHassio/binary_sensor.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ The name of the binary sensor.
object_id string (optional)
Used instead of name for automatic generation of entity_id

default_entity_id string (optional)
Used instead of name for automatic generation of entity_id - alternate for homeassistant

off_delay integer (optional)
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.

Expand Down
4 changes: 4 additions & 0 deletions cmdHassio/button.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ func (m *Mqtt) ButtonPublishConfig(config EntityConfig) error {
// StateTopic: JoinStringsForTopic(m.switchPrefix, id, "state"),
CommandTopic: String(JoinStringsForTopic(m.Prefix, LabelButton, m.ClientId, id, "cmd")),
ObjectId: String(id),
DefaultEntityID: String(id),
UniqueId: String(id),
Qos: 0,
Retain: true,
Expand Down Expand Up @@ -127,6 +128,9 @@ type Button struct {
// Used instead of name for automatic generation of entity_id
ObjectId String `json:"object_id,omitempty"`

// Alternate for ObjectId required by Home Assistant
DefaultEntityID String `json:"default_entity_id,omitempty"`

// The payload that represents the available state.
PayloadAvailable String `json:"payload_available,omitempty" default:"online"`

Expand Down
3 changes: 3 additions & 0 deletions cmdHassio/button.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ The name to use when displaying this button.
object_id string (optional)
Used instead of name for automatic generation of entity_id

default_entity_id string (optional)
Used instead of name for automatic generation of entity_id - alternate for homeassistant

payload_available string (optional, default: online)
The payload that represents the available state.

Expand Down
4 changes: 4 additions & 0 deletions cmdHassio/camera.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ func (m *Mqtt) CameraPublishConfig(config EntityConfig) error {
// StateTopic: JoinStringsForTopic(m.switchPrefix, id, "state"),
// CommandTopic: String(JoinStringsForTopic(m.switchPrefix, id, "cmd")),
ObjectId: String(id),
DefaultEntityID: String(id),
UniqueId: String(id),
// Qos: 0,
// Retain: true,
Expand Down Expand Up @@ -127,6 +128,9 @@ type Camera struct {
// Used instead of name for automatic generation of entity_id
ObjectId String `json:"object_id,omitempty"`

// Alternate for ObjectId required by Home Assistant
DefaultEntityID String `json:"default_entity_id,omitempty"`

// The MQTT topic to subscribe to.
Topic String `json:"topic,omitempty" required:"true"`

Expand Down
3 changes: 3 additions & 0 deletions cmdHassio/camera.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ The name of the camera.
object_id string (optional)
Used instead of name for automatic generation of entity_id

default_entity_id string (optional)
Used instead of name for automatic generation of entity_id - alternate for homeassistant

topic string REQUIRED
The MQTT topic to subscribe to.

Expand Down
4 changes: 4 additions & 0 deletions cmdHassio/climate.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ func (m *Mqtt) ClimatePublishConfig(config EntityConfig) error {
// StateTopic: JoinStringsForTopic(m.switchPrefix, id, "state"),
// CommandTopic: String(JoinStringsForTopic(m.switchPrefix, id, "cmd")),
ObjectId: String(id),
DefaultEntityID: String(id),
UniqueId: String(id),
Qos: 0,
Retain: true,
Expand Down Expand Up @@ -185,6 +186,9 @@ type Climate struct {
// Used instead of name for automatic generation of entity_id
ObjectId String `json:"object_id,omitempty"`

// Alternate for ObjectId required by Home Assistant
DefaultEntityID String `json:"default_entity_id,omitempty"`

// The payload that represents the available state.
PayloadAvailable String `json:"payload_available,omitempty" default:"online"`

Expand Down
3 changes: 3 additions & 0 deletions cmdHassio/climate.txt
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ The name of the HVAC.
object_id string (optional)
Used instead of name for automatic generation of entity_id

default_entity_id string (optional)
Used instead of name for automatic generation of entity_id - alternate for homeassistant

payload_available string (optional, default: online)
The payload that represents the available state.

Expand Down
4 changes: 4 additions & 0 deletions cmdHassio/cover.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ func (m *Mqtt) CoverPublishConfig(config EntityConfig) error {
// StateTopic: JoinStringsForTopic(m.switchPrefix, id, "state"),
CommandTopic: String(JoinStringsForTopic(m.Prefix, LabelCover, m.ClientId, id, "cmd")),
ObjectId: String(id),
DefaultEntityID: String(id),
UniqueId: String(id),
Qos: 0,
Retain: true,
Expand Down Expand Up @@ -130,6 +131,9 @@ type Cover struct {
// Used instead of name for automatic generation of entity_id
ObjectId String `json:"object_id,omitempty"`

// Alternate for ObjectId required by Home Assistant
DefaultEntityID String `json:"default_entity_id,omitempty"`

// Flag that defines if switch works in optimistic mode.
Optimistic Boolean `json:"optimistic,omitempty"`

Expand Down
3 changes: 3 additions & 0 deletions cmdHassio/cover.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ The name of the cover.
object_id string (optional)
Used instead of name for automatic generation of entity_id

default_entity_id string (optional)
Used instead of name for automatic generation of entity_id - alternate for homeassistant

optimistic boolean (optional)
Flag that defines if switch works in optimistic mode.

Expand Down
4 changes: 4 additions & 0 deletions cmdHassio/device_tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ func (m *Mqtt) DeviceTrackerPublishConfig(config EntityConfig) error {
// StateTopic: JoinStringsForTopic(m.switchPrefix, id, "state"),
// CommandTopic: String(JoinStringsForTopic(m.switchPrefix, id, "cmd")),
ObjectId: String(id),
DefaultEntityID: String(id),
UniqueId: String(id),
Qos: 0,
// Retain: true,
Expand Down Expand Up @@ -114,6 +115,9 @@ type DeviceTracker struct {
// Used instead of name for automatic generation of entity_id
ObjectId String `json:"object_id,omitempty"`

// Alternate for ObjectId required by Home Assistant
DefaultEntityID String `json:"default_entity_id,omitempty"`

// The payload that represents the available state.
PayloadAvailable String `json:"payload_available,omitempty" default:"online"`

Expand Down
3 changes: 3 additions & 0 deletions cmdHassio/device_tracker.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ The name of the MQTT device_tracker.
object_id string (optional)
Used instead of name for automatic generation of entity_id

default_entity_id string (optional)
Used instead of name for automatic generation of entity_id - alternate for homeassistant

payload_available string (optional, default: online)
The payload that represents the available state.

Expand Down
4 changes: 4 additions & 0 deletions cmdHassio/fan.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ func (m *Mqtt) FanPublishConfig(config EntityConfig) error {
// StateTopic: JoinStringsForTopic(m.switchPrefix, id, "state"),
CommandTopic: String(JoinStringsForTopic(m.Prefix, LabelFan, m.ClientId, id, "cmd")),
ObjectId: String(id),
DefaultEntityID: String(id),
UniqueId: String(id),
Qos: 0,
Retain: true,
Expand Down Expand Up @@ -129,6 +130,9 @@ type Fan struct {
// Used instead of name for automatic generation of entity_id
ObjectId String `json:"object_id,omitempty"`

// Alternate for ObjectId required by Home Assistant
DefaultEntityID String `json:"default_entity_id,omitempty"`

// Flag that defines if fan works in optimistic mode
Optimistic Boolean `json:"optimistic,omitempty"`

Expand Down
3 changes: 3 additions & 0 deletions cmdHassio/fan.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ The name of the fan.
object_id string (optional)
Used instead of name for automatic generation of entity_id

default_entity_id string (optional)
Used instead of name for automatic generation of entity_id - alternate for homeassistant

optimistic boolean (optional)
Flag that defines if fan works in optimistic mode

Expand Down
4 changes: 4 additions & 0 deletions cmdHassio/humidifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ func (m *Mqtt) HumidifierPublishConfig(config EntityConfig) error {
// StateTopic: JoinStringsForTopic(m.switchPrefix, id, "state"),
CommandTopic: String(JoinStringsForTopic(m.Prefix, LabelHumidifier, m.ClientId, id, "cmd")),
ObjectId: String(id),
DefaultEntityID: String(id),
UniqueId: String(id),
Qos: 0,
Retain: true,
Expand Down Expand Up @@ -138,6 +139,9 @@ type Humidifier struct {
// Used instead of name for automatic generation of entity_id
ObjectId String `json:"object_id,omitempty"`

// Alternate for ObjectId required by Home Assistant
DefaultEntityID String `json:"default_entity_id,omitempty"`

// Flag that defines if humidifier works in optimistic mode
Optimistic Boolean `json:"optimistic,omitempty"`

Expand Down
3 changes: 3 additions & 0 deletions cmdHassio/humidifier.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ The name of the humidifier.
object_id string (optional)
Used instead of name for automatic generation of entity_id

default_entity_id string (optional)
Used instead of name for automatic generation of entity_id - alternate for homeassistant

optimistic boolean (optional)
Flag that defines if humidifier works in optimistic mode

Expand Down
4 changes: 4 additions & 0 deletions cmdHassio/lights.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ func (m *Mqtt) PublishLightConfig(config EntityConfig) error {
StateTopic: String(JoinStringsForTopic(m.Prefix, LabelLight, m.ClientId, id, "state")),
UniqueId: String(id),
ObjectId: String(id),
DefaultEntityID: String(id),

// StateClass: config.StateClass,
// UniqueId: id,
Expand Down Expand Up @@ -193,6 +194,9 @@ type Light struct {
// Used instead of name for automatic generation of entity_id
ObjectId String `json:"object_id,omitempty"`

// Alternate for ObjectId required by Home Assistant
DefaultEntityID String `json:"default_entity_id,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.
OnCommandType String `json:"on_command_type,omitempty"`

Expand Down
3 changes: 3 additions & 0 deletions cmdHassio/lights.txt
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,9 @@ The name of the light.
object_id string (optional)
Used instead of name for automatic generation of entity_id

default_entity_id string (optional)
Used instead of name for automatic generation of entity_id - alternate for homeassistant

on_command_type string (optional)
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.

Expand Down
4 changes: 4 additions & 0 deletions cmdHassio/lock.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ func (m *Mqtt) LockPublishConfig(config EntityConfig) error {
// StateTopic: JoinStringsForTopic(m.switchPrefix, id, "state"),
CommandTopic: String(JoinStringsForTopic(m.Prefix, LabelLock, m.ClientId, id, "cmd")),
ObjectId: String(id),
DefaultEntityID: String(id),
UniqueId: String(id),
Qos: 0,
Retain: true,
Expand Down Expand Up @@ -126,6 +127,9 @@ type Lock struct {
// Used instead of name for automatic generation of entity_id
ObjectId String `json:"object_id,omitempty"`

// Alternate for ObjectId required by Home Assistant
DefaultEntityID String `json:"default_entity_id,omitempty"`

// Flag that defines if lock works in optimistic mode.
Optimistic Boolean `json:"optimistic,omitempty"`

Expand Down
3 changes: 3 additions & 0 deletions cmdHassio/lock.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ The name of the lock.
object_id string (optional)
Used instead of name for automatic generation of entity_id

default_entity_id string (optional)
Used instead of name for automatic generation of entity_id - alternate for homeassistant

optimistic boolean (optional)
Flag that defines if lock works in optimistic mode.

Expand Down
4 changes: 4 additions & 0 deletions cmdHassio/number.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ func (m *Mqtt) NumberPublishConfig(config EntityConfig) error {
// StateTopic: JoinStringsForTopic(m.switchPrefix, id, "state"),
CommandTopic: String(JoinStringsForTopic(m.Prefix, LabelNumber, m.ClientId, id, "cmd")),
ObjectId: String(id),
DefaultEntityID: String(id),
UniqueId: String(id),
Qos: 0,
Retain: true,
Expand Down Expand Up @@ -138,6 +139,9 @@ type Number struct {
// Used instead of name for automatic generation of entity_id
ObjectId String `json:"object_id,omitempty"`

// Alternate for ObjectId required by Home Assistant
DefaultEntityID String `json:"default_entity_id,omitempty"`

// Flag that defines if number works in optimistic mode.
Optimistic Boolean `json:"optimistic,omitempty"`

Expand Down
3 changes: 3 additions & 0 deletions cmdHassio/number.txt
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ The name of the Number.
object_id string (optional)
Used instead of name for automatic generation of entity_id

default_entity_id string (optional)
Used instead of name for automatic generation of entity_id - alternate for homeassistant

optimistic boolean (optional)
Flag that defines if number works in optimistic mode.

Expand Down
4 changes: 4 additions & 0 deletions cmdHassio/scene.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ func (m *Mqtt) ScenePublishConfig(config EntityConfig) error {
// StateTopic: JoinStringsForTopic(m.switchPrefix, id, "state"),
CommandTopic: String(JoinStringsForTopic(m.Prefix, LabelScene, m.ClientId, id, "cmd")),
ObjectId: String(id),
DefaultEntityID: String(id),
UniqueId: String(id),
Qos: 0,
Retain: true,
Expand Down Expand Up @@ -114,6 +115,9 @@ type Scene struct {
// Used instead of name for automatic generation of entity_id
ObjectId String `json:"object_id,omitempty"`

// Alternate for ObjectId required by Home Assistant
DefaultEntityID String `json:"default_entity_id,omitempty"`

// The payload that represents the available state.
PayloadAvailable String `json:"payload_available,omitempty" default:"online"`

Expand Down
3 changes: 3 additions & 0 deletions cmdHassio/scene.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ The name to use when displaying this scene.
object_id string (optional)
Used instead of name for automatic generation of entity_id

default_entity_id string (optional)
Used instead of name for automatic generation of entity_id - alternate for homeassistant

payload_available string (optional, default: online)
The payload that represents the available state.

Expand Down
4 changes: 4 additions & 0 deletions cmdHassio/select.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ func (m *Mqtt) SelectPublishConfig(config EntityConfig, fn mqtt.MessageHandler)
CommandTemplate: Template(fmt.Sprintf(`{{ value }}`)),
CommandTopic: String(cmdTopic),
ObjectId: String(id),
DefaultEntityID: String(id),
UniqueId: String(id),
Qos: 0,
Retain: true,
Expand Down Expand Up @@ -140,6 +141,9 @@ type Select struct {
// Used instead of name for automatic generation of entity_id
ObjectId String `json:"object_id,omitempty"`

// Alternate for ObjectId required by Home Assistant
DefaultEntityID String `json:"default_entity_id,omitempty"`

// Flag that defines if the select works in optimistic mode.
Optimistic Boolean `json:"optimistic,omitempty"`

Expand Down
3 changes: 3 additions & 0 deletions cmdHassio/select.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ The name of the Select.
object_id string (optional)
Used instead of name for automatic generation of entity_id

default_entity_id string (optional)
Used instead of name for automatic generation of entity_id - alternate for homeassistant

optimistic boolean (optional)
Flag that defines if the select works in optimistic mode.

Expand Down
Loading