Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

configuration.yaml does not parse properly for HomeAssistant #44

Open
TaosEnergy opened this issue Mar 5, 2022 · 6 comments
Open

configuration.yaml does not parse properly for HomeAssistant #44

TaosEnergy opened this issue Mar 5, 2022 · 6 comments

Comments

@TaosEnergy
Copy link

From line 149 down (#Template Sensor) the file does not validate/ does not parse properly. There is some sort of syntax issue(s). I used codebeautify.org/yaml-validator

@LEECHER1
Copy link
Collaborator

LEECHER1 commented Mar 6, 2022

Hey,

Thx i will check it, but the YAML files is only an example.

@guevara777
Copy link

guevara777 commented Jul 1, 2022

The way MQTT-Entities are managed have changed since one of the last Home-Asstitant-Updates. I made a MQTT-Configuration myself and would like to share it with you. Feel free to use it:

I added this to my configuration.yaml
mqtt: !include mqtt.yaml

i added a mqtt.yaml-file with this content:
(in this configuration i created a DEVICE to which the entities belong)

# Pool Heizungssteuerung
climate:
- unique_id: intex_pool_hvac
  name: "Intex Pool"

  # Gerät
  device:
    identifiers:
      - "Intex Spa"
    manufacturer: "Intex"
    model: "SPA"
    name: "Intex Spa Pool"
  
  modes: 
    - "heat"
    - "auto"
  current_temperature_topic: "IntexSpa/Actual Temperature"
  temperature_command_topic: "IntexSpa/Cmd Temperature Setpoint"
  temperature_state_topic: "IntexSpa/Temperature Setpoint"
  
  payload_on: "1"
  payload_off: "0"
  payload_available: "1"
  payload_not_available: "0"
  
  mode_command_topic: "IntexSpa/CMD HVAC Modeset"
  mode_state_topic: "IntexSpa/CMD HVAC Modeset"
  mode_state_template: >-
    {% set values = { '1':'auto', '2':'heat',  '3':'cool', '0':'off'} %}
    {{ values[value] if value in values.keys() else 'off' }}
  mode_command_template: >-
    {% set values = { 'auto':'4', 'heat':'5',  'cool':'3', 'off':'0'} %}
    {{ values[value] if value in values.keys() else '4' }}

  max_temp: "40"
  min_temp: "10"


# Intex Pool ESP-Restart Button
button:
- unique_id: intex_pool_restart
  device:
    identifiers:
      - "Intex Spa"
    manufacturer: "Intex"
    model: "SPA"
    name: "Intex Spa Pool"
  command_topic: IntexSpa/Cmd Reset ESP
  payload_press: "reset"
  name: "Intex Pool Restart"
  entity_category: "config"
  device_class: "restart"

# Intex Pool Decrease SetTemp Button
- unique_id: intex_pool_decrease
  device:
    identifiers:
      - "Intex Spa"
    manufacturer: "Intex"
    model: "SPA"
    name: "Intex Spa Pool"
  command_topic: IntexSpa/Cmd decrease
  payload_press: "1"
  name: "Intex Pool Set Temp Decrease"

# Intex Pool Increase SetTemp Button
- unique_id: intex_pool_increase
  device:
    identifiers:
      - "Intex Spa"
    manufacturer: "Intex"
    model: "SPA"
    name: "Intex Spa Pool"
  command_topic: IntexSpa/Cmd increase
  payload_press: "1"
  name: "Intex Pool Set Temp Increase"

# Intex Pool Filter Time Input Select
select:
- unique_id: intex_pool_filter_setup_time_select
  device:
    identifiers:
      - "Intex Spa"
    manufacturer: "Intex"
    model: "SPA"
    name: "Intex Spa Pool"
  command_topic: IntexSpa/Cmd water filter time
  #state_topic: IntexSpa/filter setup time
  name: "Intex Pool Filter Setup Time Select"
  options:
    - "0"
    - "2"
    - "4"
    - "6"

# MQTT Pool Schalter
switch:
- unique_id: intex_pool_power_switch
  device:
    identifiers:
      - "Intex Spa"
    manufacturer: "Intex"
    model: "SPA"
    name: "Intex Spa Pool"
  command_topic: IntexSpa/Cmd Power on off
  state_topic: IntexSpa/Power on
  payload_on: "1"
  payload_off: "0"
  name: "Intex Pool Power"
  
- unique_id: intex_pool_filter_switch
  device:
    identifiers:
      - "Intex Spa"
    manufacturer: "Intex"
    model: "SPA"
    name: "Intex Spa Pool"
  command_topic: IntexSpa/Cmd water filter on off
  state_topic: IntexSpa/filter on
  payload_on: "1"
  payload_off: "0"
  name: "Intex Pool Filter"
  
- unique_id: intex_pool_bubble_switch
  device:
    identifiers:
      - "Intex Spa"
    manufacturer: "Intex"
    model: "SPA"
    name: "Intex Spa Pool"
  command_topic: IntexSpa/Cmd bubble on off
  state_topic: IntexSpa/Bubble on
  payload_on: "1"
  payload_off: "0"
  name: "Intex Pool Bubble"
  
- unique_id: intex_pool_heater_switch
  device:
    identifiers:
      - "Intex Spa"
    manufacturer: "Intex"
    model: "SPA"
    name: "Intex Spa Pool"
  command_topic: IntexSpa/Cmd heater on off
  state_topic: IntexSpa/heater on
  payload_on: "1"
  payload_off: "0"
  name: "Intex Pool Heat"

# MQTT Pool Sensoren
sensor:
- unique_id: intex_pool_status
  device:
    identifiers:
      - "Intex Spa"
    manufacturer: "Intex"
    model: "SPA"
    name: "Intex Spa Pool"
  name: "Intex Pool Status"
  state_topic: "IntexSpa/Error Number"
  unit_of_measurement: 'E'
- unique_id: intex_pool_actual_temperature
  device:
    identifiers:
      - "Intex Spa"
    manufacturer: "Intex"
    model: "SPA"
    name: "Intex Spa Pool"
  name: "Intex Pool Actual Temperature"
  state_topic: "IntexSpa/Actual Temperature"
  unit_of_measurement: '°c'
- unique_id: intex_pool_set_temperature
  device:
    identifiers:
      - "Intex Spa"
    manufacturer: "Intex"
    model: "SPA"
    name: "Intex Spa Pool"
  name: "Intex Pool Set Temperature"
  state_topic: "IntexSpa/Temperature Setpoint"
  unit_of_measurement: '°c'
- unique_id: intex_pool_heater_status
  device:
    identifiers:
      - "Intex Spa"
    manufacturer: "Intex"
    model: "SPA"
    name: "Intex Spa Pool"
  name: "Intex Pool Heater Status"
  state_topic: "IntexSpa/heater state"
  value_template: >
    {% if value|float == 0 %}
      aus
    {% elif value|float == 1 %}
      standby
    {% elif value|float == 2 %}
      an
    {% endif %}

# Intex Pool Binärsensoren
binary_sensor:
  - unique_id: intex_pool_pumpenkommunikation
    device:
      identifiers:
        - "Intex Spa"
      manufacturer: "Intex"
      model: "SPA"
      name: "Intex Spa Pool"
    name: "Intex Pool Pumpenkommunikation"
    state_topic: "IntexSpa/Communication with pump"
    payload_on: "1"
    payload_off: "0"
    device_class: connectivity

@LEECHER1
Copy link
Collaborator

LEECHER1 commented Jul 2, 2022 via email

@guevara777
Copy link

image

That has changed ;) -> https://www.home-assistant.io/blog/2022/06/01/release-20226/ -> See "Breaking Changes"

@rommess
Copy link

rommess commented Jun 13, 2023

Hi guys, i'de like to share my "code" in the new format, as i seen many poeple having trouble. based on @guevara777 code.
work for me so far.
@Portos1327 maybe you're interested ? :)


mqtt:

  # Intex Pool ESP-Restart Button
  button:
  - unique_id: intex_pool_restart
    device:
      identifiers:
        - "Intex Spa"
      manufacturer: "Intex"
      model: "SPA"
      name: "Intex Spa Pool"
    command_topic: IntexSpa/Cmd Reset ESP
    payload_press: "reset"
    name: "Intex Pool Restart"
    entity_category: "config"
    device_class: "restart"
  
  # Intex Pool Decrease SetTemp Button
  - unique_id: intex_pool_decrease
    device:
      identifiers:
        - "Intex Spa"
      manufacturer: "Intex"
      model: "SPA"
      name: "Intex Spa Pool"
    command_topic: IntexSpa/Cmd decrease
    payload_press: "1"
    name: "Intex Pool Set Temp Decrease"
  
  # Intex Pool Increase SetTemp Button
  - unique_id: intex_pool_increase
    device:
      identifiers:
        - "Intex Spa"
      manufacturer: "Intex"
      model: "SPA"
      name: "Intex Spa Pool"
    command_topic: IntexSpa/Cmd increase
    payload_press: "1"
    name: "Intex Pool Set Temp Increase"
  
  # Select
  select:
  
  # Intex Pool Filter Time Input Select
  - unique_id: intex_pool_filter_setup_time_select
    device:
      identifiers:
        - "Intex Spa"
      manufacturer: "Intex"
      model: "SPA"
      name: "Intex Spa Pool"
    command_topic: IntexSpa/Cmd water filter time
    state_topic: IntexSpa/filter setup time
    name: "Intex Pool Filter Setup Time Select"
    options:
#      - "0"
      - "2"
      - "4"
      - "6"
  
  # Intex Pool Sanitizer Time Input Select
  - unique_id: intex_pool_sanitizer_setup_time_select
    device:
        identifiers:
          - "Intex Spa"
        manufacturer: "Intex"
        model: "SPA"
        name: "Intex Spa Pool"
    command_topic: IntexSpa/Cmd Sanitizer time
    state_topic: IntexSpa/Sanitizer setup time
    name: "Intex Pool Sanitizer Setup Time Select"
    options:
#        - "0"
        - "3"
        - "5"
        - "8"
  
  # MQTT Pool Schalter
  switch:
  
  - unique_id: intex_pool_power_switch
    device:
      identifiers:
        - "Intex Spa"
      manufacturer: "Intex"
      model: "SPA"
      name: "Intex Spa Pool"
    command_topic: IntexSpa/Cmd Power on off
    state_topic: IntexSpa/Power on
    payload_on: "1"
    payload_off: "0"
    name: "Intex Pool Power"
    
  - unique_id: intex_pool_filter_switch
    device:
      identifiers:
        - "Intex Spa"
      manufacturer: "Intex"
      model: "SPA"
      name: "Intex Spa Pool"
    command_topic: IntexSpa/Cmd water filter on off
    state_topic: IntexSpa/filter on
    payload_on: "1"
    payload_off: "0"
    name: "Intex Pool Filter"
    
  - unique_id: intex_pool_bubble_switch
    device:
      identifiers:
        - "Intex Spa"
      manufacturer: "Intex"
      model: "SPA"
      name: "Intex Spa Pool"
    command_topic: IntexSpa/Cmd bubble on off
    state_topic: IntexSpa/Bubble on
    payload_on: "1"
    payload_off: "0"
    name: "Intex Pool Bubble"
    
  - unique_id: intex_pool_heater_switch
    device:
      identifiers:
        - "Intex Spa"
      manufacturer: "Intex"
      model: "SPA"
      name: "Intex Spa Pool"
    command_topic: IntexSpa/Cmd heater on off
    state_topic: IntexSpa/heater on
    payload_on: "1"
    payload_off: "0"
    name: "Intex Pool Heat"

  - unique_id: intex_pool_water_jet_switch
    device:
      identifiers:
        - "Intex Spa"
      manufacturer: "Intex"
      model: "SPA"
      name: "Intex Spa Pool"
    command_topic: IntexSpa/Cmd water jet on off
    state_topic: IntexSpa/Water jet on
    payload_on: "1"
    payload_off: "0"
    name: "Intex Pool Water Jet"

  - unique_id: intex_pool_sanitizer_switch
    device:
      identifiers:
        - "Intex Spa"
      manufacturer: "Intex"
      model: "SPA"
      name: "Intex Spa Pool"
    command_topic: IntexSpa/Cmd sanitizer on off
    state_topic: IntexSpa/Sanitizer on
    payload_on: "1"
    payload_off: "0"
    name: "Intex Pool Sanitizer"

  # MQTT Pool Sensoren
  sensor:
  - unique_id: intex_pool_status
    device:
      identifiers:
        - "Intex Spa"
      manufacturer: "Intex"
      model: "SPA"
      name: "Intex Spa Pool"
    name: "Intex Pool Status"
    state_topic: "IntexSpa/Error Number"
    unit_of_measurement: 'E'
  - unique_id: intex_pool_actual_temperature
    device:
      identifiers:
        - "Intex Spa"
      manufacturer: "Intex"
      model: "SPA"
      name: "Intex Spa Pool"
    name: "Intex Pool Actual Temperature"
    state_topic: "IntexSpa/Actual Temperature"
    unit_of_measurement: '°c'
  - unique_id: intex_pool_set_temperature
    device:
      identifiers:
        - "Intex Spa"
      manufacturer: "Intex"
      model: "SPA"
      name: "Intex Spa Pool"
    name: "Intex Pool Set Temperature"
    state_topic: "IntexSpa/Temperature Setpoint"
    unit_of_measurement: '°c'
  - unique_id: intex_pool_heater_status
    device:
      identifiers:
        - "Intex Spa"
      manufacturer: "Intex"
      model: "SPA"
      name: "Intex Spa Pool"
    name: "Intex Pool Heater Status"
    state_topic: "IntexSpa/heater state"
    value_template: >
      {% if value|float == 0 %}
        off
      {% elif value|float == 1 %}
        standby
      {% elif value|float == 2 %}
        on
      {% endif %}

  # Intex Pool Binärsensoren
  binary_sensor:
    - unique_id: intex_pool_pumpenkommunikation
      device:
        identifiers:
          - "Intex Spa"
        manufacturer: "Intex"
        model: "SPA"
        name: "Intex Spa Pool"
      name: "Intex Pool Pumpenkommunikation"
      state_topic: "IntexSpa/Communication with pump"
      payload_on: "1"
      payload_off: "0"
      device_class: connectivity

@Portos1327
Copy link

hi rommess, thank you very much for your work I will look at what it looks like in Ha

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants