Closed bcameron21 closed 1 year ago
I don't think this is a binary sesnor, but rather one that returns different values with different meanings. This is my code for it.
- platform: modbus_controller # 244 Settings Energy Management Model modbus_controller_id: sunsynk name: "Energy management model" id: sunsynk_energy_model register_type: holding address: 244 raw_encode: HEXBYTES lambda: |- uint16_t value = modbus_controller::word_from_hex_str(x, 0); switch (value) { case 0: return std::string("Selling First"); case 1: return std::string("Zero Export and Limit to Load Only"); case 2: return std::string("Zero Export"); default: return std::string("Unknown"); } return x;
The raw_encode setting causes an error. Any suggestions?
Nevermind, I had it in the wrong section of code, will update the git shortly. Thanks for the contribution!
I don't think this is a binary sesnor, but rather one that returns different values with different meanings. This is my code for it.