Home IO Control
ESPHome add-on for IO-Homecontrol devices
Loading...
Searching...
No Matches
esphome::home_io_control::IOHomeSunLevelSensor Class Reference

Sensor publishing the raw sun value a device answers its sun level poll with. More...

#include <platform_cover_controls.h>

Inheritance diagram for esphome::home_io_control::IOHomeSunLevelSensor:
Collaboration diagram for esphome::home_io_control::IOHomeSunLevelSensor:

Public Member Functions

void setup () override
 Subscribe to the device's updates and publish what is already known.
void dump_config () override
 Dump sensor configuration to the log.
Public Member Functions inherited from esphome::home_io_control::IOHomeCompanionSensor
float get_setup_priority () const override
 Get setup priority so the parent hub is available first.
Public Member Functions inherited from esphome::home_io_control::DeviceBoundCompanion
void set_parent (IOHomeControlComponent *parent)
 Set the parent controller component.
void set_device_id (const std::string &id)
 Set the device ID whose state this companion sensor exposes.

Protected Attributes

std::optional< uint16_t > published_
 Last value handed to publish_state(); avoids re-publishing on every update.
bool published_once_ {false}
 True once anything (a value or "unknown") was published.
Protected Attributes inherited from esphome::home_io_control::DeviceBoundCompanion
IOHomeControlComponent * parent_ {nullptr}
std::string device_id_

Additional Inherited Members

Protected Member Functions inherited from esphome::home_io_control::DeviceBoundCompanion
void register_companion_binding_ (const std::function< void(const IoDevice &)> &publish)
 Shared setup() body: subscribe to this device's updates and publish the initial state.

Detailed Description

Sensor publishing the raw sun value a device answers its sun level poll with.

Only generated when the cover declares sun_level_poll_interval:, which also schedules the poll that feeds it (a subscription to EVENT_LOCAL_SENSOR, ADR 0064). Publishes the number as the device sends it, with no unit: 0 at night, rising with sun on the panel. No state until the first answered poll, and again after several unanswered polls.

Todo
Unit and scale unknown; confirmed on one Somfy RS100 Solar io only (issue #156).

Definition at line 161 of file platform_cover_controls.h.

Member Function Documentation

◆ dump_config()

void esphome::home_io_control::IOHomeSunLevelSensor::dump_config ( )
override

Dump sensor configuration to the log.

Definition at line 133 of file platform_cover_controls.cpp.

◆ setup()

void esphome::home_io_control::IOHomeSunLevelSensor::setup ( )
override

Subscribe to the device's updates and publish what is already known.

Definition at line 121 of file platform_cover_controls.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ published_

std::optional<uint16_t> esphome::home_io_control::IOHomeSunLevelSensor::published_
protected

Last value handed to publish_state(); avoids re-publishing on every update.

Definition at line 170 of file platform_cover_controls.h.

◆ published_once_

bool esphome::home_io_control::IOHomeSunLevelSensor::published_once_ {false}
protected

True once anything (a value or "unknown") was published.

Definition at line 171 of file platform_cover_controls.h.


The documentation for this class was generated from the following files: