Skip to content

Commit

Permalink
Initial GVH5182 (#16)
Browse files Browse the repository at this point in the history
Updated Readme
Updated blerry.be
  • Loading branch information
tony-fav committed Jan 11, 2022
1 parent ccdb519 commit 7a0979e
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 12 deletions.
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,17 @@ If you use HA discovery, devices should appear under MQTT Devices NOT the Tasmot

## Supported Sensors

| Model String | Mac Example | Description |
| ------------ | ----------- | ----------- |
| `'ATCpvvx'` | `'A4C138XXXXXX'` | Xiaomi sensors on ATC or pvvx firmware with "ATC1441" or "Custom" advertisement |
| `'ATCmi'` | `'A4C138XXXXXX'` | Xiaomi sensors on ATC or pvvx firmware with "Mi" advertisement |
| `'GVH5075'` | `'A4C138XXXXXX'` | Govee H5075. Should work for H5072 as well (untested). |
| `'GVH5183'` | `'A4C138XXXXXX'` | Govee H5183 single probe meat thermometer. |
| `'GVH5184'` | `'D03232XXXXXX/1'` | Govee H5184 four probe meat thermometer with display. |
| `'IBSTH2'` | `'494208XXXXXX'` | Inkbird IBSTH2 with and without humidity. Should work for IBSTH1 as well (untested). |
| Model String | Mac Example | Description |
| -------------- | ------------------ | ----------- |
| `'ATCpvvx'` | `'A4C138XXXXXX'` | Xiaomi sensors on ATC or pvvx firmware with "ATC1441" or "Custom" advertisement. |
| `'ATCmi'` | `'A4C138XXXXXX'` | Xiaomi sensors on ATC or pvvx firmware with "Mi" advertisement. |
| `'GVH5075'` | `'A4C138XXXXXX'` | Govee H5072 and H5075. |
| `'GVH5182'` | `'C33130XXXXXX/1'` | Govee H5182 two probe meat thermometer with display. Thanks carlthehaitian! |
| `'GVH5183'` | `'A4C138XXXXXX'` | Govee H5183 single probe meat thermometer. |
| `'GVH5184'` | `'D03232XXXXXX/1'` | Govee H5184 four probe meat thermometer with display. Thanks ElksInNC! |
| `'IBSTH2'` | `'494208XXXXXX'` | Inkbird IBSTH1 & IBSTH2 with and without humidity. |
| `'WoSensorTH'` | `'D4E4A3XXXXXX/1'` | Switchbot temperature and humidity sensor. |
| `'WoContact'` | `'D4BD28XXXXXX/1'` | Switchbot contact sensor (also has motion, binary lux, and a button). |
| `'WoContact'` | `'D4BD28XXXXXX/1'` | Switchbot contact sensor (also has motion, binary lux, and a button). |
| `'WoPresence'` | `'FC7CADXXXXXX/1'` | Switchbot motion sensor (also has binary lux). |

## Development Status
Expand All @@ -44,7 +45,6 @@ I *have* the following devices that I am seeking to support:
- Switchbot Curtain
- Switchbot Remote
- SP611E (LED Controller)
- Xiaomi sensors on ATC firmware with mi-like advertisement.

I *do not have* the following devices but would like to support them as they have been discussed in Digiblur's Discord.
- Govee H5074
Expand Down
7 changes: 5 additions & 2 deletions blerry/blerry.be
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,19 @@
# publish_attributes OPTIONAL (default = false) publish individual topics for each attribute in addition to the JSON payload
# temp_precision OPTIONAL (default = 2, int) digits of precision for temperature
# humi_precision OPTIONAL (default = 1, int) digits of precision for humidity
var user_config = {'A4C138AAAAAA': {'alias': 'trial_govee5075', 'model': 'GVH5075', 'discovery': true},
var user_config = {
'A4C138AAAAAA': {'alias': 'trial_govee5075', 'model': 'GVH5075', 'discovery': true},
'A4C138BBBBBB': {'alias': 'other_govee5075', 'model': 'GVH5075', 'via_pubs': false},
'C33130XXXXXX/1': {'alias': 'govee5182-2probe-meats', 'model': 'GVH5182'},
'A4C138XXXXXX': {'alias': 'govee5183meats', 'model': 'GVH5183'},
'D03232XXXXXX/1': {'alias': 'govee5184-4probe-meats', 'model': 'GVH5184'},
'A4C138CCCCCC': {'alias': 'trial_ATCpvvx', 'model': 'ATCpvvx', 'discovery': true, 'use_lwt': true},
'A4C138CCCCCC': {'alias': 'ATC_on_milike', 'model': 'ATCmi'},
'494208DDDDDD': {'alias': 'trial_inkbird', 'model': 'IBSTH2', 'discovery': true},
'D4E4A3BBBBBB/1': {'alias': 'sbot_TH', 'model': 'WoSensorTH'},
'D4BD28AAAAAA/1': {'alias': 'sbot_contact', 'model': 'WoContact'},
'FC7CADCCCCCC/1': {'alias': 'sbot_motion', 'model': 'WoPresence'}}
'FC7CADCCCCCC/1': {'alias': 'sbot_motion', 'model': 'WoPresence'},
}
var base_topic = 'tele/tasmota_blerry' # where to publish the sensor data


Expand Down
1 change: 1 addition & 0 deletions blerry/blerry_main.be
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ end

# Load model handle functions only if used
var model_drivers = {'GVH5075' : 'blerry_model_GVH5075.be',
'GVH5182' : 'blerry_model_GVH5182.be',
'GVH5183' : 'blerry_model_GVH5183.be',
'GVH5184' : 'blerry_model_GVH5184.be',
'ATCpvvx' : 'blerry_model_ATCpvvx.be',
Expand Down
73 changes: 73 additions & 0 deletions blerry/blerry_model_GVH5182.be
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
def handle_GVH5182(value, trigger, msg)
if trigger == details_trigger
var this_device = device_config[value['mac']]
var p = bytes(value['p'])
var i = 0
var adv_len = 0
var adv_data = bytes('')
var adv_type = 0
while i < size(p)
adv_len = p.get(i,1)
adv_type = p.get(i+1,1)
adv_data = p[i+2..i+adv_len]
if (adv_type == 0xFF) && (adv_len == 0x14)
var this_data = [adv_data.get(10, -2), adv_data.get(12, -2), adv_data.geti(15, -2), adv_data.geti(17, -2)]
var last_data = this_device['last_p']
if (last_data != bytes('')) && (this_data == last_data)
return 0
end
device_config[value['mac']]['last_p'] = this_data
if this_device['discovery'] && !this_device['done_disc']
publish_sensor_discovery(value['mac'], 'Temperature_1', 'temperature', '°C')
publish_sensor_discovery(value['mac'], 'Temperature_1_Target', 'temperature', '°C')
publish_sensor_discovery(value['mac'], 'Temperature_2', 'temperature', '°C')
publish_sensor_discovery(value['mac'], 'Temperature_2_Target', 'temperature', '°C')
publish_sensor_discovery(value['mac'], 'RSSI', 'signal_strength', 'dB')
device_config[value['mac']]['done_disc'] = true
end
var output_map = {}
output_map['Time'] = tasmota.time_str(tasmota.rtc()['local'])
output_map['alias'] = this_device['alias']
output_map['mac'] = value['mac']
output_map['via_device'] = device_topic
output_map['RSSI'] = value['RSSI']
if this_device['via_pubs']
output_map['Time_via_' + device_topic] = output_map['Time']
output_map['RSSI_via_' + device_topic] = output_map['RSSI']
end
if this_data[0] == 65535
output_map['Temperature_1'] = 'unavailable'
else
output_map['Temperature_1'] = round(this_data[0]/100.0, this_device['temp_precision'])
end
if this_data[1] == 65535
output_map['Temperature_1_Target'] = 'unavailable'
else
output_map['Temperature_1_Target'] = round(this_data[1]/100.0, this_device['temp_precision'])
end
if this_data[2] == 65535
output_map['Temperature_2'] = 'unavailable'
else
output_map['Temperature_2'] = round(this_data[2]/100.0, this_device['temp_precision'])
end
if this_data[3] == 65535
output_map['Temperature_2_Target'] = 'unavailable'
else
output_map['Temperature_2_Target'] = round(this_data[3]/100.0, this_device['temp_precision'])
end
var this_topic = base_topic + '/' + this_device['alias']
tasmota.publish(this_topic, json.dump(output_map), this_device['sensor_retain'])
if this_device['publish_attributes']
for output_key:output_map.keys()
tasmota.publish(this_topic + '/' + output_key, string.format('%s', output_map[output_key]), this_device['sensor_retain'])
end
end
end
i = i + adv_len + 1
end
end
end

# map function into handles array
device_handles['GVH5182'] = handle_GVH5182
require_active['GVH5182'] = false

0 comments on commit 7a0979e

Please sign in to comment.