tony-fav / tasmota-blerry

GNU General Public License v3.0
96 stars 29 forks source link

New driver and supporting other mods - GVH5184 #12

Closed ElksInNC closed 2 years ago

ElksInNC commented 2 years ago

The following changes are being submited.

Readme - updated to show MAC address format for this driver. blerry.be - added sample MAC entry to show format for this device blerry_main.be - added handling for new driver blerry_model_GVH5184.be - different approach than other drivers due to multiple probes and 2-line data packets Govspoof_devices.be - added the two-packet sequence for the dummy mac - using modulus of the time entry already used in the spoofing driver. This ensures the packets do not arrive at the same time and simulates that you can get two sequence1 (or2) packets in a row. It validates the logic that discovery does not happen until bank 1 and bank 2 have arrived at least once.

Testing: 1) Deleted entity from HA. 2) Restarted HA - ensured entity was gone. 3) Removed references to Govee4Probe from MQTT via MQTT Explorer. 4) Restarted BLE32Solo1 device with above modified _.be files loaded in file system. For testing the blerry.be contained these entries:

var user_config = {'D03232363E5D/1': {'alias': 'Govee-4Probe', 'model': 'GVH5184', 'discovery': true},
                                'D03232XXXXXX/1': {'alias': 'Govee-4Probe-Fake', 'model': 'GVH5184', 'discovery': true}}

5) Observed the following: a) MQTT entries for in homeassistant/sensor and in tele/tasmota_blerry b) MQTT device was created in HA with all expected entities

6) The helper code was pasted into the berry console on the device. The fake device was created and updates as well.

Currently the driver code has a counter that will force an update after 30 reports that do not have a change to them. If there is an update the counter is reset to zero. This can easily be removed if another approach is desired.