Weber iGrill 2 integration with Lovelace UI

@stogs, some progress I believe…I set username and password in my mqtt broker and now i am getting the following:

However, I still don’t see the sensors in Hassio…is there additional config I have to do there? I don’t see the probe in the entities or the mqtt devices.

also why is it disconnecting at the end?>

Up higher in the thread you will see the stuff that needs to be added to the configuration.yaml to define the sensors in HA.

When you said you added a user, did you add that user and password to your mqtt.yaml for the igrill and to the hassio broker config as logins?

[quote=“stogs, post:103, topic:61880, full:true”]
Up higher in the thread you will see the stuff that needs to be added to the configuration.yaml to define the sensors in HA.[/quote]
The way I had originally setup all my MQTT devices is through the integration. When a new device broadcasts it gets added automatically.

Hence I didn’t think I would need to manually add it to the configuration.yaml file.

yes, I added to both places. since then the broker is at least accepting the connection but then it is dropping.

I have added the sensor under mqtt platform. but the state shows unknown.

Ok got it to work but following the troubleshooting done by steeldragon. I will do the writeup including the step by step tomorrow. Thanks for all the help! I still need to do the ui etc. but at least I can read the temp of the probe now.

This is the step by step I did to set this up with a pi and a 16gb sd card (you can use other size card).

  1. Download rapbian lite and write on microSD using etcher
  2. Before plugging into the pi, create a file called ssh on the boot directory
  3. Plug in the pi and use putty to ssh to the pi (you need to find the ip from your router. I used LAN)
  4. VERY IMPORTANT: Make sure your mqtt broker username in the mqtt broker config is not identical to any Hassio username (I had this and my broker rejected the connections from the pi)
  5. Login (pi/raspberry) and run the following commands
sudo apt-get update
sudo apt full-upgrade
sudo apt-get install git
git clone https://github.com/bendikwa/igrill
sudo apt-get install python-pip libglib2.0-dev
sudo pip install bluepy
sudo pip install paho-mqtt
sudo pip install PyYAML
sudo pip install yamlreader
sudo pip install future
cd igrill/
sudo nano device.yaml
# here you can copy paste the device code form the example config and modify to your liking. Save the file (my settings below)
sudo nano mqtt.yaml
# here you can copy paste the device code form the example config and modify to your liking. Save the file (my settings below)
sudo nano /lib/systemd/system/igrill.service
#put the systemd startup script information in here (my settings below)
sudo -i
systemctl daemon-reload && systemctl enable igrill && systemctl start igrill
reboot

device.yaml and mqtt.yaml is under the igrill folder
device.yaml

devices:
  - name:       'igrill'                  # Unique name of the device
    type:       'igrill_v2'              # Supported devices: igrill_mini, igrill_v2, igrill_v3
    address:    'YOUR:MAC'      # The MAC of the device
    topic:      'bbq'    # The topic to publish on. will have name and probe number appended: <$
    interval:   20                       # Polling interval

mqtt.yaml

mqtt:
  host:       'YOUR MQTT HOST IP'                   # Optional default 'localhost'
  port:       1883                                 # Optional default '1883'
  keepalive:  40                                   # Optional default '60'
  auth:                                            # Optional If included, username_pw_set() is called $
    username: 'mqttusername'                               # Required (when auth is present)
    password: 'mqttpassword'                                # Optional

igrill.service is under /lib/systemd/system/ folder
igrill.service

[Unit]
Description=igrill MQTT service
After=network.target

[Service]
Type=simple
Restart=always
RestartSec=2
ExecStart=/usr/bin/python /home/pi/igrill/monitor.py -c /home/pi/igrill

[Install]
WantedBy=multi-user.target

sensor.yaml in Hassio

- platform: mqtt
  state_topic: "bbq/grill/probe1"
  name: "Probe 1"
  qos: 0
  unit_of_measurement: "°C"

You still have to do you lovelace ui configs as you please after.

THE FOLLOWING IS AN UPDATE TO THE HOME ASSISTANT SIDE CONFIG INCLUDING LOVELACE UI. (I did this due to some issues with not able to get my iGrill to report temp as °F. This might be because my HA is set up for °C)

I changed the UI a bit because I wanted to see the temp in both C and F. I tried to get temp in F by changing the unit of measure in the iGrill app, but even though on the iGrill it displayed F, in HA it still came in a C. So I just left this at C and added a few template sensors. I also did the F to C conversion for the inputs/targets etc. The UI looks as follows now (sorry didn’t take the screenshots with some actual probe readings).

Lovelace Raw is as follows (you will need to have the Custom Gauge Card installed):

  - badges: []
    cards:
      - type: glance
        entities:
          - entity: sensor.dark_sky_summary
            name: Current Weather
          - entity: sensor.dark_sky_temperature
            name: Current Temperature
          - entity: sensor.dark_sky_temperature_1h
            name: Next Hour Forecast
      - type: vertical-stack
        cards:
          - type: horizontal-stack
            cards:
              - type: vertical-stack
                cards:
                  - type: 'custom:gauge-card'
                    entity: sensor.probe_1
                    max: 177
                    min: -18
                    severity: null
                    yellow: -18
                    green: 18
                    red: 87
                    title: Probe 1
                  - type: glance
                    entities:
                      - entity: sensor.probe_1_f
                      - entity: sensor.target_alert_temp_probe_1
                    show_name: false
                    show_icon: false
              - type: vertical-stack
                cards:
                  - type: 'custom:gauge-card'
                    entity: sensor.probe_2
                    max: 177
                    min: -18
                    severity: null
                    amber: -18
                    green: 18
                    red: 87
                    title: Probe 2
                  - type: glance
                    entities:
                      - entity: sensor.probe_2_f
                      - entity: sensor.target_alert_temp_probe_2
                    show_name: false
                    show_icon: false
          - type: horizontal-stack
            cards:
              - type: vertical-stack
                cards:
                  - type: 'custom:gauge-card'
                    entity: sensor.probe_3
                    max: 177
                    min: -18
                    severity: null
                    amber: -18
                    green: 18
                    red: 87
                    title: Probe 3
                  - type: glance
                    entities:
                      - entity: sensor.probe_3_f
                      - entity: sensor.target_alert_temp_probe_3
                    show_name: false
                    show_icon: false
              - type: vertical-stack
                cards:
                  - type: 'custom:gauge-card'
                    entity: sensor.probe_4
                    max: 177
                    min: -18
                    severity: null
                    amber: -18
                    green: 18
                    red: 87
                    title: Probe 4 (Grill)
                  - type: glance
                    entities:
                      - entity: sensor.probe_4_f
                      - entity: sensor.grill_alert_temp
                    show_name: false
                    show_icon: false
      - type: vertical-stack
        cards:
          - type: vertical-stack
            cards:
              - type: entities
                title: Grill Temp Info (C)
                show_header_toggle: false
                entities:
                  - entity: input_number.grill_alert_low
                    name: Low
                  - entity: input_number.grill_alert_high
                    name: High
                show_name: true
                show_icon: true
                show_state: true
              - type: glance
                entities:
                  - entity: sensor.grill_alert_low_f
                    name: Low
                  - entity: sensor.grill_alert_temp
                    name: State
                  - entity: sensor.grill_alert_high_f
                    name: High
                show_name: true
                show_icon: false
          - type: vertical-stack
            cards:
              - type: entities
                title: Probe Temp Targets (C)
                show_header_toggle: false
                entities:
                  - entity: input_number.grill_probe_1_target
                    name: Probe 1
                  - entity: input_number.grill_probe_2_target
                    name: Probe 2
                  - entity: input_number.grill_probe_3_target
                    name: Probe 3
                show_name: true
                show_icon: true
                show_state: true
              - type: glance
                entities:
                  - entity: sensor.grill_probe_1_target_f
                    name: Probe 1
                  - entity: sensor.grill_probe_2_target_f
                    name: Probe 2
                  - entity: sensor.grill_probe_3_target_f
                    name: Probe 3
                show_name: true
                show_icon: false
              - type: glance
                entities:
                  - entity: sensor.target_alert_temp_probe_1
                    name: Probe 1 State
                  - entity: sensor.target_alert_temp_probe_2
                    name: Probe 2 State
                  - entity: sensor.target_alert_temp_probe_3
                    name: Probe 3 State
                show_name: false
                show_icon: false
      - entities:
          - entity: sensor.probe_1
          - entity: sensor.probe_2
          - entity: sensor.probe_3
          - entity: sensor.probe_4
        hours_to_show: 1
        refresh_interval: 0
        title: History
        type: history-graph
    icon: 'mdi:cow'
    path: igrill
    title: iGrill

My configuration.yaml

############## INPUT NUMBERS #############   
input_number:
    grill_alert_low:
        name: Grill Low Temp
        initial: 65
        min: 38
        max: 260
        step: 1
    grill_alert_high:
        name: Grill High Temp
        initial: 170
        min: 38
        max: 260
        step: 1
    grill_probe_1_target:
        name: Probe 1 Target Temp
        initial: 70
        min: 15
        max: 125
        step: 1
    grill_probe_2_target:
        name: Probe 2 Target Temp
        initial: 70
        min: 15
        max: 125
        step: 1
    grill_probe_3_target:
        name: Probe 3 Target Temp
        initial: 70
        min: 15
        max: 125
        step: 1

I have my sensors separated in the sensor.yaml

######### iGRILL PROBE SENSORS C ##############
- platform: mqtt
  state_topic: "bbq/grill/probe1"
  name: "Probe 1"
  qos: 0
  unit_of_measurement: '°C'
- platform: mqtt
  state_topic: "bbq/grill/probe2"
  name: "Probe 2"
  qos: 0
  unit_of_measurement: '°C'
- platform: mqtt
  state_topic: "bbq/grill/probe3"
  name: "Probe 3"
  qos: 0
  unit_of_measurement: '°C'
- platform: mqtt
  state_topic: "bbq/grill/probe4"
  name: "Probe 4"
  qos: 0
  unit_of_measurement: '°C'
- platform: mqtt
  state_topic: "bbq/grill/battery"
  name: "igrill battery"
  qos: 0
  unit_of_measurement: "%"

############# iGRILL PROBE SENSORS F ###########
- platform: template
  sensors:
    probe_1_f:
     friendly_name: "Probe 1 F"
     unit_of_measurement: 'ºF'
     value_template: "{{ (((states('sensor.probe_1') | float) * 9/5)+ 32)|round(1)}}"
- platform: template
  sensors:
    probe_2_f:
     friendly_name: "Probe 2 F"
     unit_of_measurement: 'ºF'
     value_template: "{{ (((states('sensor.probe_2') | float) * 9/5)+ 32)|round(1)}}"
- platform: template
  sensors:
    probe_3_f:
     friendly_name: "Probe 3 F"
     unit_of_measurement: 'ºF'
     value_template: "{{ (((states('sensor.probe_3') | float) * 9/5)+ 32)|round(1)}}"
- platform: template
  sensors:
    probe_4_f:
     friendly_name: "Probe 4 F"
     unit_of_measurement: 'ºF'
     value_template: "{{ (((states('sensor.probe_4') | float) * 9/5)+ 32)|round(1)}}"

########### iGRILL ALERT SENSORS ############
- platform: template
  sensors:
    grill_alert_temp:
     friendly_name: "Grill Temp Alert"
     value_template: >-
      {% if (states.sensor.probe_4.state | int) < (states.input_number.grill_alert_low.state | int) or (states.sensor.probe_4.state | int)  > (states.input_number.grill_alert_high.state | int) %}
       Alert
      {% else %}
       Normal
      {% endif %}
- platform: template
  sensors:
    target_alert_temp_probe_1:
     friendly_name: "Probe 1 Target Alert"
     value_template: >-
      {% if (states.sensor.probe_1.state | int) >= (states.input_number.grill_probe_1_target.state | int) %}
       Alert
      {% else %}
       Normal
      {% endif %}  
- platform: template
  sensors:
    target_alert_temp_probe_2:
     friendly_name: "Probe 2 Target Alert"
     value_template: >-
      {% if (states.sensor.probe_2.state | int) >= (states.input_number.grill_probe_2_target.state | int) %}
       Alert
      {% else %}
       Normal
      {% endif %}
- platform: template
  sensors:
    target_alert_temp_probe_3:
     friendly_name: "Probe 3 Target Alert"
     value_template: >-
      {% if (states.sensor.probe_3.state | int) >= (states.input_number.grill_probe_3_target.state | int) %}
       Alert
      {% else %}
       Normal
      {% endif %}

############# iGRILL INPUT SENSOR F ############
- platform: template
  sensors:
    grill_alert_low_f:
     friendly_name: "Grill Low Temp F"
     unit_of_measurement: 'ºF'
     value_template: "{{ (((states('input_number.grill_alert_low') | float) * 9/5)+ 32)|round(1)}}"
- platform: template
  sensors:
    grill_alert_high_f:
     friendly_name: "Grill High Temp F"
     unit_of_measurement: 'ºF'
     value_template: "{{ (((states('input_number.grill_alert_high') | float) * 9/5)+ 32)|round(1)}}"
- platform: template
  sensors:
    grill_probe_1_target_f:
     friendly_name: "Probe 1 Target Temp F"
     unit_of_measurement: 'ºF'
     value_template: "{{ (((states('input_number.grill_probe_1_target') | float) * 9/5)+ 32)|round(1)}}"
- platform: template
  sensors:
    grill_probe_2_target_f:
     friendly_name: "Probe 2 Target Temp F"
     unit_of_measurement: 'ºF'
     value_template: "{{ (((states('input_number.grill_probe_2_target') | float) * 9/5)+ 32)|round(1)}}"
- platform: template
  sensors:
    grill_probe_3_target_f:
     friendly_name: "Probe 3 Target Temp F"
     unit_of_measurement: 'ºF'
     value_template: "{{ (((states('input_number.grill_probe_3_target') | float) * 9/5)+ 32)|round(1)}}"
4 Likes

@war100, I will try and write up a bullet point list of the steps I went through. One thing that got me was I was unit testing by running ./monitor.py but that was getting errors. Eventually after reading through all of the posts, I figured out I had to add the -c /pi/home/igrill because like STOGGS, I have all of my files in the iGrill directory rather than having an additional Config file. I would also recommend initally that you log errors to a file, I can get that code to you when I am home later tonight. The logs helped me immensely.

I also had a problem running the ./monitor on bootup, I had to add a user = pi somewhere. I will get you that specific code as well.

Great summary, I guess you can disregard my previous post as it looks like you got everything working.

good to see you got it working.

I have installed the requisite script on the pi as shown by war1000 above. How do I know it is working? My iGrill3 keeps blinking blue so I don’t think it is pairing. I want to make sure this first part is working before moving to the HA stuff :slight_smile:

Quick edit:
The blue light flashes fast for about 25 seconds then turns solid blue so I think it is connecting. After that the blue light flashes once every 5-10 seconds or so.

I do not have an igrill3 so not sure about the blinking every 5-10 secs. My igrill2 is always solid blue. did you put igrill_v3 in your device.yaml?

I confirmed with the iGrill app that the iGrill 3 also has a solid blue light when connected. It would appear that my iGrill is connecting for only a few seconds before being disconnected.

If I stop the igrill service, and go into bluetooth to pair manually I see the same behavior and here is what I get:

[bluetooth]# pair 70:91:8F:0A:6F:12
Attempting to pair with 70:91:8F:0A:6F:12
[CHG] Device 70:91:8F:0A:6F:12 Connected: yes
[iGrill_V3]#
[CHG] Device 70:91:8F:0A:6F:12 ServicesResolved: yes
[iGrill_V3]#
[CHG] Device 70:91:8F:0A:6F:12 ServicesResolved: no
[CHG] Device 70:91:8F:0A:6F:12 Connected: no
[bluetooth]#
Failed to pair: org.bluez.Error.AuthenticationCanceled

The pi connects and recognizes it is an iGrill_V3, but it immediately disconnects.Not sure what to try next!

All, I am having an issue and I hope someone can help what I am missing.

Here is my setup. HA running on Docker on my Synology, Pi3B running Buster mqtt client (igrill v2), ubuntu running as Broker.

I see the Pi connected to the igrill just fine; however, I question if mqtt is functioning as it should. .9 is Ubuntu, .7 is Synology, .190 is pi.

tcp 0 0 0.0.0.0:1883 0.0.0.0:* LISTEN 8881/mosquitto
tcp 0 0 192.168.1.9:1883 192.168.1.7:42508 ESTABLISHED 8881/mosquitto
tcp 0 0 192.168.1.9:1883 192.168.1.190:34381 ESTABLISHED 8881/mosquitto
tcp6 0 0 :::1883 :::* LISTEN 8881/mosquitto

Here is my pi Yaml configs
mqtt:
host: ‘192.168.1.9’ # Optional default ‘localhost’
port: 1883 # Optional default ‘1883’
keepalive: 60 # Optional default ‘60’

devices:

  • name: ‘igrill’ # Unique name of the device
    type: ‘igrill_v2’ # Supported devices: igrill_mini, igrill_v2, igrill_v3
    address: ‘70:91:8F:0C:A6:85’ # The MAC of the device
    topic: ‘bbq’ # The topic to publish on. will have name and probe number appended: <$
    interval: 20 # Polling interval

Here is my pi connected to BT:
[email protected]:~/igrill $ bluetoothctl
Agent registered
[iGrill_V2-A685]# devices
Device 70:91:8F:0C:A6:85 iGrill_V2-A685
[iGrill_V2-A685]#

I see this when I kick off monitor.py: (never shows authenticating, may be normal not sure)
[email protected]:~/igrill $ ./monitor.py
2020-01-20 21:28:44,860 MainThread INFO: log_level set to: INFO

Here is what I see on my UI (of course not reading correctly)

Ok, so i think i have an issue in HA i am a bit of a noob to HA.

1579574351: New connection from 192.168.1.7 on port 1883.
1579574351: New client connected from 192.168.1.7 as 34be1e99-bc6d-4bf6-aa94-cc386391f219 (c1, k60).
1579574351: Sending CONNACK to 34be1e99-bc6d-4bf6-aa94-cc386391f219 (0, 0)
1579574352: Received SUBSCRIBE from 34be1e99-bc6d-4bf6-aa94-cc386391f219
1579574352: bbq/grill/probe3 (QoS 0)
1579574352: 34be1e99-bc6d-4bf6-aa94-cc386391f219 0 bbq/grill/probe3
1579574352: Sending SUBACK to 34be1e99-bc6d-4bf6-aa94-cc386391f219
1579574355: Received SUBSCRIBE from 34be1e99-bc6d-4bf6-aa94-cc386391f219
1579574355: bbq/grill/probe4 (QoS 0)
1579574355: 34be1e99-bc6d-4bf6-aa94-cc386391f219 0 bbq/grill/probe4
1579574355: Sending SUBACK to 34be1e99-bc6d-4bf6-aa94-cc386391f219
1579574356: Received SUBSCRIBE from 34be1e99-bc6d-4bf6-aa94-cc386391f219
1579574356: bbq/grill/battery (QoS 0)
1579574356: 34be1e99-bc6d-4bf6-aa94-cc386391f219 0 bbq/grill/battery
1579574356: Sending SUBACK to 34be1e99-bc6d-4bf6-aa94-cc386391f219
1579574357: Received SUBSCRIBE from 34be1e99-bc6d-4bf6-aa94-cc386391f219
1579574357: bbq/grill/probe1 (QoS 0)
1579574357: 34be1e99-bc6d-4bf6-aa94-cc386391f219 0 bbq/grill/probe1
1579574357: Sending SUBACK to 34be1e99-bc6d-4bf6-aa94-cc386391f219
1579574358: Received SUBSCRIBE from 34be1e99-bc6d-4bf6-aa94-cc386391f219
1579574358: bbq/grill/probe2 (QoS 0)
1579574358: 34be1e99-bc6d-4bf6-aa94-cc386391f219 0 bbq/grill/probe2
1579574358: Sending SUBACK to 34be1e99-bc6d-4bf6-aa94-cc386391f219
1579574367: Received PUBLISH from ebb99a0f-8b59-4bb3-aabd-b1fe11307e89 (d0, q0, r0, m0, ‘bbq/igrill/probe1’, … (4 bytes))
1579574367: Received PUBLISH from ebb99a0f-8b59-4bb3-aabd-b1fe11307e89 (d0, q0, r0, m0, ‘bbq/igrill/probe2’, … (4 bytes))
1579574367: Received PUBLISH from ebb99a0f-8b59-4bb3-aabd-b1fe11307e89 (d0, q0, r0, m0, ‘bbq/igrill/probe3’, … (4 bytes))
1579574367: Received PUBLISH from ebb99a0f-8b59-4bb3-aabd-b1fe11307e89 (d0, q0, r0, m0, ‘bbq/igrill/battery’, … (4 bytes))
1579574388: Received PUBLISH from ebb99a0f-8b59-4bb3-aabd-b1fe11307e89 (d0, q0, r0, m0, ‘bbq/igrill/probe1’, … (4 bytes))
1579574388: Received PUBLISH from ebb99a0f-8b59-4bb3-aabd-b1fe11307e89 (d0, q0, r0, m0, ‘bbq/igrill/probe2’, … (4 bytes))
1579574388: Received PUBLISH from ebb99a0f-8b59-4bb3-aabd-b1fe11307e89 (d0, q0, r0, m0, ‘bbq/igrill/probe3’, … (4 bytes))
1579574388: Received PUBLISH from ebb99a0f-8b59-4bb3-aabd-b1fe11307e89 (d0, q0, r0, m0, ‘bbq/igrill/battery’, … (4 bytes))
1579574409: Received PUBLISH from ebb99a0f-8b59-4bb3-aabd-b1fe11307e89 (d0, q0, r0, m0, ‘bbq/igrill/probe1’, … (4 bytes))
1579574409: Received PUBLISH from ebb99a0f-8b59-4bb3-aabd-b1fe11307e89 (d0, q0, r0, m0, ‘bbq/igrill/probe2’, … (4 bytes))
1579574409: Received PUBLISH from ebb99a0f-8b59-4bb3-aabd-b1fe11307e89 (d0, q0, r0, m0, ‘bbq/igrill/probe3’, … (4 bytes))
1579574409: Received PUBLISH from ebb99a0f-8b59-4bb3-aabd-b1fe11307e89 (d0, q0, r0, m0, ‘bbq/igrill/battery’, … (4 bytes))

lol

After posting the log i figured it out.

I must have looked at that mqtt a thousand times, a missing ‘i’ on igrill on sensors.

On your pi remove the device form bluetooth and add it in again as a new device.

Tired that to no avail. Went and bought a pi zero w,fresh install, same issue. Then I found the troubleshooting section here: https://github.com/bendikwa/igrill#troubleshooting

I commented out the line of code in /lib/udev/rules.d/90-pi-bluetooth.rules as suggested and am now up and running!

excellent news

What’s the furthest away that people have been successful with on these? Any chance it’d work through an outer house brick wall (with sheeting, etc) plus 3 feet of space on each side? I know they advertise it Bluetooth 4.0 and “up to” 45 meters, but let’s just say I don’t trust marketing departments :slight_smile: Thanks!

This whole thread has been INCREDIBLY helpful. Thank you very much, @stogs, for all of your guidance. I am a linux/raspberry pi/home assistant/docker novice, but I used this integration as a great learning experience.

To that end, I created a docker-compose script to dockerize bendiwka’s iGrill interfacing/monitoring script. Hopefully the standardization of a docker container can help fellow novices by making everything much easier to repeat. I’ve documented my success in a step-by-step manner and wanted to share it with anyone else who may be reading this thread looking for help. The tutorial is the repo readme found here: https://github.com/WilliamAlexanderMorrison/igrill-hassio

Good luck and let me know if there are any questions!

2 Likes