41 lines
5.9 KiB
JSON
41 lines
5.9 KiB
JSON
[
|
|
{
|
|
"id": "my_battery2_sync_modbus_and_input_select",
|
|
"result": {
|
|
"structured": "TRIGGER: When My Battery2 User Work Mode [sensor.my_battery2_user_work_mode] changes state OR When My Battery2 User Work Mode Input Select [input_select.my_battery2_user_work_mode_input_select] changes state. CONDITIONS: None. ACTIONS: If the trigger is My Battery2 User Work Mode [sensor.my_battery2_user_work_mode], then set My Battery2 User Work Mode Input Select [input_select.my_battery2_user_work_mode_input_select] to 'Manual' (if sensor value is 0), 'Anti-Feed' (if sensor value is 1), or 'Trade Mode' (if sensor value is 2), defaulting to 'Manual' otherwise. If the trigger is My Battery2 User Work Mode Input Select [input_select.my_battery2_user_work_mode_input_select], then write to Modbus register 43000 (hub MarstekVenus2, slave 1) the value 0 (if input select is 'Manual'), 1 (if input select is 'Anti-Feed'), or 2 (if input select is 'Trade Mode'), defaulting to 0 otherwise.",
|
|
"natural_language": {
|
|
"trigger": "The automation is triggered whenever the sensor My Battery2 User Work Mode [sensor.my_battery2_user_work_mode] changes its state, or whenever the dropdown selector My Battery2 User Work Mode Input Select [input_select.my_battery2_user_work_mode_input_select] is changed by a user.",
|
|
"conditions": "There are no conditions that must be met for the automation to run.",
|
|
"action": "Depending on which trigger occurred, the automation performs one of two actions. If the sensor changed, it updates the dropdown selector to match the sensor's numeric value, mapping 0 to 'Manual', 1 to 'Anti-Feed', and 2 to 'Trade Mode'. If the dropdown selector was changed by a user, it writes the corresponding numeric value (0 for 'Manual', 1 for 'Anti-Feed', 2 for 'Trade Mode') to a specific Modbus register on the battery system to apply the new mode."
|
|
},
|
|
"human_like": "Keeps a battery work mode sensor and a user interface selector in sync, updating one when the other changes.",
|
|
"complexity": "medium"
|
|
}
|
|
},
|
|
{
|
|
"id": "my_battery3_sync_modbus_and_input_select",
|
|
"result": {
|
|
"structured": "TRIGGER: When My Battery3 User Work Mode [sensor.my_battery3_user_work_mode] changes state OR When My Battery3 User Work Mode Input Select [input_select.my_battery3_user_work_mode_input_select] changes state. CONDITIONS: None. ACTIONS: If the trigger is sensor_to_input_select, then set My Battery3 User Work Mode Input Select [input_select.my_battery3_user_work_mode_input_select] to 'Manual' if the sensor value is 0, to 'Anti-Feed' if the sensor value is 1, to 'Trade Mode' if the sensor value is 2, otherwise to 'Manual'. If the trigger is input_select_to_sensor, then write to modbus register 43000 on hub 'MarstekVenus3', slave 1, the value 0 if the input_select state is 'Manual', 1 if the state is 'Anti-Feed', 2 if the state is 'Trade Mode', otherwise 0.",
|
|
"natural_language": {
|
|
"trigger": "The automation is triggered whenever the sensor My Battery3 User Work Mode [sensor.my_battery3_user_work_mode] changes its state, or whenever the user interface selector My Battery3 User Work Mode Input Select [input_select.my_battery3_user_work_mode_input_select] is changed.",
|
|
"conditions": "There are no conditions that must be met for the actions to run.",
|
|
"action": "Depending on which trigger occurred, the automation performs a different action to keep the sensor and the user interface selector in sync. If the sensor changed, the automation updates the selector to match: it sets the selector to 'Manual' for a sensor value of 0, 'Anti-Feed' for 1, and 'Trade Mode' for 2. If the user changes the selector, the automation writes the corresponding numerical value (0 for 'Manual', 1 for 'Anti-Feed', 2 for 'Trade Mode') to a specific register on the battery's modbus device to update the actual battery mode."
|
|
},
|
|
"human_like": "Keeps the battery's work mode selector and its underlying sensor value synchronized, updating one when the other changes.",
|
|
"complexity": "medium"
|
|
}
|
|
},
|
|
{
|
|
"id": "my_battery_sync_modbus_and_input_select",
|
|
"result": {
|
|
"structured": "TRIGGER: When My Battery User Work Mode [sensor.my_battery_user_work_mode] changes state OR When My Battery User Work Mode Input Select [input_select.my_battery_user_work_mode_input_select] changes state. CONDITIONS: None. ACTIONS: Choose based on trigger ID. IF trigger ID is sensor_to_input_select THEN set My Battery User Work Mode Input Select [input_select.my_battery_user_work_mode_input_select] to 'Manual' when sensor value is 0, 'Anti-Feed' when sensor value is 1, 'Trade Mode' when sensor value is 2, otherwise 'Manual'. IF trigger ID is input_select_to_sensor THEN write to modbus register (hub: MarstekVenus, address: 43000, slave: 1) value 0 when input select is 'Manual', value 1 when input select is 'Anti-Feed', value 2 when input select is 'Trade Mode', otherwise value 0.",
|
|
"natural_language": {
|
|
"trigger": "This automation triggers whenever the sensor My Battery User Work Mode [sensor.my_battery_user_work_mode] changes its state, or whenever the dropdown selector My Battery User Work Mode Input Select [input_select.my_battery_user_work_mode_input_select] is changed by a user.",
|
|
"conditions": "There are no conditions; the automation runs immediately upon either trigger.",
|
|
"action": "Depending on which trigger fired, the automation performs a bidirectional sync. If the sensor changed, it updates the dropdown selector to match the sensor's numeric value, mapping 0 to 'Manual', 1 to 'Anti-Feed', and 2 to 'Trade Mode'. If the dropdown selector was changed by a user, it writes the corresponding numeric value back to the battery's modbus register to change its actual operating mode."
|
|
},
|
|
"human_like": "Keeps the battery's work mode selector and its actual sensor value in sync, allowing control from either the UI or the device.",
|
|
"complexity": "medium"
|
|
}
|
|
}
|
|
] |