mirror of
https://github.com/adrianjagielak/home-assistant-futurehome.git
synced 2025-09-13 07:37:09 +00:00
Add support for 'dev_sys' service
This commit is contained in:
parent
cfe51c6e71
commit
9aac6c489f
43
README.md
43
README.md
@ -61,35 +61,30 @@ todo add info about factory reset hub to restore 30 day trial
|
||||
| Keypad | [user_code](https://github.com/adrianjagielak/home-assistant-futurehome/blob/master/futurehome/src/services/user_code.ts) | | ✅ | [Sensor](https://www.home-assistant.io/integrations/sensor/), [Binary sensor](https://www.home-assistant.io/integrations/binary_sensor/), [Button](https://www.home-assistant.io/integrations/button/), [Text](https://www.home-assistant.io/integrations/text/)|
|
||||
| Water heater | [water_heater](https://github.com/adrianjagielak/home-assistant-futurehome/blob/master/futurehome/src/services/water_heater.ts) | | ✅ | [Water heater](https://www.home-assistant.io/integrations/water_heater/) |
|
||||
|
||||
## Problematic services
|
||||
## Implemented system services
|
||||
|
||||
| Name | Service | Implementation status | Home Assistant entity |
|
||||
| --- | --- | --- | --- |
|
||||
| Identify device | [indicator_ctrl](https://github.com/adrianjagielak/home-assistant-futurehome/blob/master/futurehome/src/services/indicator_ctrl.ts) | | ✅ | [Button](https://www.home-assistant.io/integrations/button/) |
|
||||
| Reboot device | [dev_sys](https://github.com/adrianjagielak/home-assistant-futurehome/blob/master/futurehome/src/services/dev_sys.ts) | | ✅ | [Button](https://www.home-assistant.io/integrations/button/) |
|
||||
|
||||
## Other system, meta, unused, or not essential services
|
||||
|
||||
| Service | Description |
|
||||
| --- | --- |
|
||||
| schedule | No devices or hub support this stub service. |
|
||||
| association | |
|
||||
| battery_charge_ctrl | No devices or hub support this stub service. |
|
||||
| diagnostic | Diagnostic (logging, etc) |
|
||||
| gateway | |
|
||||
| inverter_consumer_conn | No devices or hub support this stub service. |
|
||||
| inverter_grid_conn | No devices or hub support this stub service. |
|
||||
| inverter_solar_conn | No devices or hub support this stub service. |
|
||||
|
||||
## Virtual, unnecessary services (easily reproduced in stock Home Assistant)
|
||||
|
||||
| Service | Description |
|
||||
| --- | --- |
|
||||
| virtual_meter_elec | A virtual electricity meter that estimates energy usage by multiplying the device's configured average power consumption with its operating duration. |
|
||||
|
||||
## System or meta, not essential services
|
||||
|
||||
| Service | Implementation status | Description |
|
||||
| --- | --- | --- |
|
||||
| gateway | | |
|
||||
| association | | |
|
||||
| diagnostic | | |
|
||||
| indicator_ctrl | ✅ | Identify devices |
|
||||
| ota | | |
|
||||
| parameters | | |
|
||||
| ota | Managing OTA updates of devices |
|
||||
| parameters | |
|
||||
| Power regulator | [power_regulator](https://github.com/adrianjagielak/home-assistant-futurehome/blob/master/futurehome/src/services/power_regulator.ts) | [16A Puck Relé](https://www.futurehome.io/en_no/shop/puck-relay-16a) | | |
|
||||
| technology_specific | | |
|
||||
| time | | |
|
||||
| time_parameters | |
|
||||
| version | | |
|
||||
| dev_sys | | |
|
||||
| schedule | No devices or hub support this stub service. |
|
||||
| technology_specific | |
|
||||
| time | Z-wave service for setting and reading time |
|
||||
| time_parameters | Z-wave service for setting and reading time |
|
||||
| version | Device hardware and software versions. Exposed through other means. |
|
||||
| virtual_meter_elec | A virtual electricity meter that estimates energy usage by multiplying the device's configured average power consumption with its operating duration. Easily reproducible using Home Assistant's built-in configuration. |
|
||||
|
@ -11,6 +11,7 @@
|
||||
- Added support for 'schedule_entry' service (for scheduling access).
|
||||
- Added support for 'doorman' service (Yale door locks).
|
||||
- Added support for 'complex_alarm_system' service (part of alarm sirens control).
|
||||
- Added support for 'dev_sys' service (reboot device).
|
||||
|
||||
## 0.1.5 (25.07.2025)
|
||||
|
||||
|
@ -60,35 +60,30 @@ todo add info about factory reset hub to restore 30 day trial
|
||||
| Keypad | [user_code](https://github.com/adrianjagielak/home-assistant-futurehome/blob/master/futurehome/src/services/user_code.ts) | | ✅ | [Sensor](https://www.home-assistant.io/integrations/sensor/), [Binary sensor](https://www.home-assistant.io/integrations/binary_sensor/), [Button](https://www.home-assistant.io/integrations/button/), [Text](https://www.home-assistant.io/integrations/text/)|
|
||||
| Water heater | [water_heater](https://github.com/adrianjagielak/home-assistant-futurehome/blob/master/futurehome/src/services/water_heater.ts) | | ✅ | [Water heater](https://www.home-assistant.io/integrations/water_heater/) |
|
||||
|
||||
## Problematic services
|
||||
## Implemented system services
|
||||
|
||||
| Name | Service | Implementation status | Home Assistant entity |
|
||||
| --- | --- | --- | --- |
|
||||
| Identify device | [indicator_ctrl](https://github.com/adrianjagielak/home-assistant-futurehome/blob/master/futurehome/src/services/indicator_ctrl.ts) | | ✅ | [Button](https://www.home-assistant.io/integrations/button/) |
|
||||
| Reboot device | [dev_sys](https://github.com/adrianjagielak/home-assistant-futurehome/blob/master/futurehome/src/services/dev_sys.ts) | | ✅ | [Button](https://www.home-assistant.io/integrations/button/) |
|
||||
|
||||
## Other system, meta, unused, or not essential services
|
||||
|
||||
| Service | Description |
|
||||
| --- | --- |
|
||||
| schedule | No devices or hub support this stub service. |
|
||||
| association | |
|
||||
| battery_charge_ctrl | No devices or hub support this stub service. |
|
||||
| diagnostic | Diagnostic (logging, etc) |
|
||||
| gateway | |
|
||||
| inverter_consumer_conn | No devices or hub support this stub service. |
|
||||
| inverter_grid_conn | No devices or hub support this stub service. |
|
||||
| inverter_solar_conn | No devices or hub support this stub service. |
|
||||
|
||||
## Virtual, unnecessary services (easily reproduced in stock Home Assistant)
|
||||
|
||||
| Service | Description |
|
||||
| --- | --- |
|
||||
| virtual_meter_elec | A virtual electricity meter that estimates energy usage by multiplying the device's configured average power consumption with its operating duration. |
|
||||
|
||||
## System or meta, not essential services
|
||||
|
||||
| Service | Implementation status | Description |
|
||||
| --- | --- | --- |
|
||||
| gateway | | |
|
||||
| association | | |
|
||||
| diagnostic | | |
|
||||
| indicator_ctrl | ✅ | Identify devices |
|
||||
| ota | | |
|
||||
| parameters | | |
|
||||
| ota | Managing OTA updates of devices |
|
||||
| parameters | |
|
||||
| Power regulator | [power_regulator](https://github.com/adrianjagielak/home-assistant-futurehome/blob/master/futurehome/src/services/power_regulator.ts) | [16A Puck Relé](https://www.futurehome.io/en_no/shop/puck-relay-16a) | | |
|
||||
| technology_specific | | |
|
||||
| time | | |
|
||||
| time_parameters | |
|
||||
| version | | |
|
||||
| dev_sys | | |
|
||||
| schedule | No devices or hub support this stub service. |
|
||||
| technology_specific | |
|
||||
| time | Z-wave service for setting and reading time |
|
||||
| time_parameters | Z-wave service for setting and reading time |
|
||||
| version | Device hardware and software versions. Exposed through other means. |
|
||||
| virtual_meter_elec | A virtual electricity meter that estimates energy usage by multiplying the device's configured average power consumption with its operating duration. Easily reproducible using Home Assistant's built-in configuration. |
|
||||
|
@ -14,6 +14,7 @@ import { battery__components } from '../services/battery';
|
||||
import { chargepoint__components } from '../services/chargepoint';
|
||||
import { color_ctrl__components } from '../services/color_ctrl';
|
||||
import { complex_alarm_system__components } from '../services/complex_alarm_system';
|
||||
import { dev_sys__components } from '../services/dev_sys';
|
||||
import { door_lock__components } from '../services/door_lock';
|
||||
import { doorman__components } from '../services/doorman';
|
||||
import { fan_ctrl__components } from '../services/fan_ctrl';
|
||||
@ -155,6 +156,7 @@ const serviceHandlers: {
|
||||
chargepoint: chargepoint__components,
|
||||
color_ctrl: color_ctrl__components,
|
||||
complex_alarm_system: complex_alarm_system__components,
|
||||
dev_sys: dev_sys__components,
|
||||
door_lock: door_lock__components,
|
||||
doorman: doorman__components,
|
||||
fan_ctrl: fan_ctrl__components,
|
||||
|
51
futurehome/src/services/dev_sys.ts
Normal file
51
futurehome/src/services/dev_sys.ts
Normal file
@ -0,0 +1,51 @@
|
||||
import { sendFimpMsg } from '../fimp/fimp';
|
||||
import {
|
||||
VinculumPd7Device,
|
||||
VinculumPd7Service,
|
||||
} from '../fimp/vinculum_pd7_device';
|
||||
import { HaMqttComponent } from '../ha/mqtt_components/_component';
|
||||
import {
|
||||
CommandHandlers,
|
||||
ServiceComponentsCreationResult,
|
||||
} from '../ha/publish_device';
|
||||
|
||||
export function dev_sys__components(
|
||||
topicPrefix: string,
|
||||
device: VinculumPd7Device,
|
||||
svc: VinculumPd7Service,
|
||||
svcName: string,
|
||||
): ServiceComponentsCreationResult | undefined {
|
||||
const components: Record<string, HaMqttComponent> = {};
|
||||
const commandHandlers: CommandHandlers = {};
|
||||
|
||||
if (svc.intf?.includes('cmd.thing.reboot')) {
|
||||
const rebootCommandTopic = `${topicPrefix}${svc.addr}/reboot/command`;
|
||||
|
||||
components[`${svc.addr}_reboot`] = {
|
||||
unique_id: `${svc.addr}_reboot`,
|
||||
platform: 'button',
|
||||
device_class: 'restart',
|
||||
entity_category: 'config',
|
||||
command_topic: rebootCommandTopic,
|
||||
};
|
||||
|
||||
commandHandlers[rebootCommandTopic] = async (_payload: string) => {
|
||||
await sendFimpMsg({
|
||||
address: svc.addr,
|
||||
service: svcName,
|
||||
cmd: 'cmd.thing.reboot',
|
||||
// App always sends a `null`. In theory some devices could support a force reboot, with `true` value.
|
||||
val_t: 'null',
|
||||
val: null,
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
// Nothing useful to expose?
|
||||
if (!Object.keys(components).length) return undefined;
|
||||
|
||||
return {
|
||||
components,
|
||||
commandHandlers,
|
||||
};
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user