Bouni / luxtronik

Luxtronik integration for Home Assistant
MIT License
82 stars 13 forks source link

Unit of datatype Power/Frequency missing #12

Open macrojames opened 3 years ago

macrojames commented 3 years ago

I am using the calculation "Heat_Output" and it doesn't show correctly in Home Assistant (Wrong graph, no unit of measurement) I guess the "Power" Datatype should be defined in const.UNITS or DEVICE_CLASSES? heat

macrojames commented 3 years ago

I just saw it's also missing on Frequencies with rpm.

Bouni commented 3 years ago

Sorry for the late reply, I need to look into this once I got some spare time 😓

corneel27 commented 3 years ago

I think this is caused because "Frequency" and "Power" are not available as "device_class" in Home Assistant. But there is a possibility to customize an entity: https://www.home-assistant.io/docs/configuration/customizing-devices/ This works well for me: Schermafdruk van 2021-02-10 15-51-12

remyderuysscher commented 3 years ago

I think this is caused because "Frequency" and "Power" are not available as "device_class" in Home Assistant. But there is a possibility to customize an entity: https://www.home-assistant.io/docs/configuration/customizing-devices/ This works well for me: Schermafdruk van 2021-02-10 15-51-12

@Cees-van-Beek Can you share the "Stooklijn verschuiving" code?

corneel27 commented 3 years ago

@remyderuysscher You must have installed the luxtronic custom component via HACS. First you need to add the entity "ID_Einst_WK_akt" to the sensors (group parameters):

- platform: luxtronik
  scan_interval: 15
  sensors:
    - group: calculations
      id: ID_WEB_Temperatur_TVL
      friendly_name: Temperatuur Aanvoer
....
    - group: parameters
      id: ID_Einst_WK_akt
....

Next you make an input_number (configuration/helpers), slider, min -3, max 3, stepsize 0,1 (it works quite good!).

Then you make two automations:

#if value changes on the luxtronik input_number is adjusted
- alias: set input number verschuiving
  trigger:
    platform: state
    entity_id: luxtronik.ID_Einst_WK_akt
  action:
    service: input_number.set_value
    data: 
      entity_id: input_number.stooklijn_verschuiving
      value: "{{ states('luxtronik.ID_Einst_WK_akt') }}"

#if input_number is changed, the new value is sent to luxtronic
- alias: set stooklijn verschuiving op luxtronik
  trigger:
  - platform: state
    entity_id: input_number.stooklijn_verschuiving
  action:
    service: luxtronik.write
    data:
      parameter: ID_Einst_WK_akt
    data_template:
      value: '{{ trigger.to_state.state }}'

Success!