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

Improving Sensibo documentation: Case Sensitivity and Examples Needed #36637

Open
Smandurlo opened this issue Jan 1, 2025 · 2 comments
Open

Comments

@Smandurlo
Copy link

Smandurlo commented Jan 1, 2025

Feedback

Hi everyone,

I’m trying to use the sensibo.full_state service to control my Sensibo devices, but the lack of detailed documentation is making it challenging.

The GitHub issue home-assistant/core#94661 and documentation mention parameters are case-sensitive, but the documentation doesn’t explain this or how to align it with Home Assistant’s lowercase attributes (e.g., swing modes).
Examples: There are no examples or links to Sensibo’s API documentation to clarify parameter formats or usage.
Templates: It’s unclear if templates are supported and how to use them effectively.

I’m trying to replace a script that sends individual commands with one using sensibo.full_state, but I keep getting errors. Clearer documentation with examples would help greatly.

Can anyone share insights or examples?

Here is my original script

script:
  controlla_climatizzatore_camera_martinetto_caldo:
    alias: Controllo climatizzatore camera martinetto caldo
    mode: single
    sequence:
      - choose:
          - conditions:
              - condition: numeric_state
                entity_id: climate.camera_martinetto
                attribute: temperature
                above: input_number.temperatura_massima_camera_martinetto
            sequence:
            -  service: climate.set_temperature
               target:
                 entity_id: climate.camera_martinetto
               data:
                 temperature: "{{ states('input_number.temperatura_massima_camera_martinetto') | float }}"
      - choose:
          - conditions:
              - condition: state
                entity_id: climate.camera_martinetto
                attribute: fan_mode
                state:
                  - "medium"
                  - "high"
            sequence:
              - service: climate.set_fan_mode
                target:
                  entity_id: climate.camera_martinetto
                data:
                  fan_mode: "auto"
      - choose:
        - conditions:
          - condition: state
            entity_id: climate.camera_martinetto
            attribute: swing_mode
            state:
            - 'fixedtop'
            - 'fixedmiddletop'
            - 'fixedmiddle'
          sequence:
          - service: climate.set_swing_mode
            target:
              entity_id: climate.camera_martinetto
            data:
              swing_mode: "fixedbottom"

and the full_state version that doesn't work

sequence:
  - action: sensibo.full_state
    data:
      mode: "{{ states('sensor.modo_climatizzatori_martinetto') }}"
      target_temperature: >
        {% if state_attr('climate.camera_martinetto', 'temperature') | float > states('input_number.temperatura_massima_camera_martinetto') | float %}
          {{ states('input_number.temperatura_massima_camera_martinetto') | float }}
        {% else %}
          {{ state_attr('climate.camera_martinetto', 'temperature') | float }}
        {% endif %}
      fan_mode: >
        {% if is_state_attr('climate.camera_martinetto', 'fan_mode', 'medium') or
              is_state_attr('climate.camera_martinetto', 'fan_mode', 'high') %}
          auto
        {% else %}
          {{ state_attr('climate.camera_martinetto', 'fan_mode') }}
        {% endif %}
      swing_mode: >
        {% if is_state_attr('climate.camera_martinetto', 'swing_mode', 'fixedtop') or
              is_state_attr('climate.camera_martinetto', 'swing_mode', 'fixedmiddletop') or
              is_state_attr('climate.camera_martinetto', 'swing_mode', 'fixedmiddle') %}
          fixedbottom
        {% else %}
          {{ state_attr('climate.camera_martinetto', 'swing_mode') }}
        {% endif %}
    target:
      entity_id: climate.camera_martinetto
description: ""

URL

https://www.home-assistant.io/integrations/sensibo/

Version

No response

Additional information

No response

@home-assistant
Copy link

home-assistant bot commented Jan 1, 2025

Hey there @andrey-git, @gjohansson-ST, mind taking a look at this feedback as it has been labeled with an integration (sensibo) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of sensibo can trigger bot actions by commenting:

  • @home-assistant close Closes the feedback.
  • @home-assistant rename Awesome new title Renames the feedback.
  • @home-assistant reopen Reopen the feedback.
  • @home-assistant unassign sensibo Removes the current integration label and assignees on the feedback, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information) to the feedback.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information) on the feedback.

@Smandurlo
Copy link
Author

Smandurlo commented Jan 1, 2025

I think I managed it with some replacements, but I believe it should be handled internally by the integration for consistency (and maybe target_temperature, it should be renamed as temperature only to be consistent with the action climate.set_temperature)

      swing_mode: >
        {% set swing_mode = state_attr('climate.camera_martinetto', 'swing_mode') %}
        {% if swing_mode == 'fixedtop' or swing_mode == 'fixedmiddletop' or swing_mode == 'fixedmiddle' %}
          fixedBottom
        {% else %}
          {% if swing_mode == 'fixedbottom' %}
            fixedBottom
          {% else %}
            {{ swing_mode | replace('fixedmiddlebottom', 'fixedMiddleBottom') | replace('rangefull', 'rangeFull') }}
          {% endif %}
        {% endif %}

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

No branches or pull requests

3 participants