Weber iGrill 2 integration with Lovelace UI

Below is a screenshot of my integration with Weber iGrill 2 into the Lovelace UI. I used the code from https://github.com/bendikwa/igrill.git to create the MQTT integration between the igrill and a raspberry pi 3. I run this code on a different raspberry pi than my Home Assistant so that I can move it around closer to the smoker for bluetooth connectivity. I already had mosquitto running on my Home Assistant instance so I just pointed the client on the new instance to that. I then created some alerts to tell me if my smoker’s ambient temperature goes out of a set range, as well as, alerts to notify me when a given probe crosses a set threshold. Nothing fancy, but I am no longer tethered to bluetooth range to keep an eye on my Traeger.

29 Likes

I was looking for something exactly like this, so thank you.

Nice use off Lovelace. I’ll be doing something similar once I get my Maverick grill thermometer working again with the RTL 433mhz stick and addon

Nice :slight_smile:

Could you share your automation, etc etc?

configuration.yaml

          - platform: mqtt
            state_topic: "bbq/grill/probe1"
            name: "Probe 1"
            qos: 0
            unit_of_measurement: "°F"
          - platform: mqtt
            state_topic: "bbq/grill/probe2"
            name: "Probe 2"
            qos: 0
            unit_of_measurement: "°F"
          - platform: mqtt
            state_topic: "bbq/grill/probe3"
            name: "Probe 3"
            qos: 0
            unit_of_measurement: "°F"
          - platform: mqtt
            state_topic: "bbq/grill/probe4"
            name: "Probe 4"
            qos: 0
            unit_of_measurement: "°F"
          - platform: mqtt
            state_topic: "bbq/grill/battery"
            name: "igrill battery"
            qos: 0
            unit_of_measurement: "%"
    - platform: template
        sensors:
          grill_alert_temp:
            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 %}'
            friendly_name: Grill Temp Alert
      - platform: template
        sensors:
          target_alert_temp_probe_1:
            value_template:
              '{% if (states.sensor.probe_1.state | int) >= (states.input_number.grill_probe_1_target.state | int) %}
                Alert
              {% else %}
                Normal
              {% endif %}'
            friendly_name: Probe 1 Target Alert
      - platform: template
        sensors:
          target_alert_temp_probe_2:
            value_template:
              '{% if (states.sensor.probe_2.state | int) >= (states.input_number.grill_probe_2_target.state | int) %}
                Alert
              {% else %}
                Normal
              {% endif %}'
            friendly_name: Probe 2 Target Alert
    - platform: template
        sensors:
          target_alert_temp_probe_3:
            value_template:
              '{% if (states.sensor.probe_3.state | int) >= (states.input_number.grill_probe_3_target.state | int) %}
                Alert
              {% else %}
                Normal
              {% endif %}'
            friendly_name: Probe 3 Target Alert
    input_number:
        grill_alert_low:
        name: Grill Low Temp
        initial: 150
        min: 100
        max: 500
        step: 5
      grill_alert_high:
        name: Grill High Temp
        initial: 340
        min: 100
        max: 500
        step: 5
      grill_probe_1_target:
        name: Probe 1 Target Temp
        initial: 160
        min: 60
        max: 250
        step: 1
      grill_probe_2_target:
        name: Probe 2 Target Temp
        initial: 160
        min: 60
        max: 250
        step: 1
      grill_probe_3_target:
        name: Probe 3 Target Temp
        initial: 160
        min: 60
        max: 250
        step: 1

automations.yaml

    - alias: "Monitor Grill Temp Alert"
      trigger:
        - platform: state
          entity_id: sensor.grill_alert_temp
          to: 'Alert'
      action:
        - service: notify.ios_notify
          data:
            message: "Grill temp outside limits. Currently {{ states.sensor.probe_4.state }} F"

    - alias: "Monitor Grill Temp Normal"
      trigger:
        - platform: state
          entity_id: sensor.grill_alert_temp
          to: 'Normal'
      action:
        - service: notify.ios_notify
          data:
            message: "Grill temp within limits. Currently {{ states.sensor.probe_4.state }} F"

    - alias: "Probe 1 Target Temp"
      trigger:
        - platform: state
          entity_id: sensor.target_alert_temp_probe_1
          to: 'Alert'
      action:
        - service: notify.ios_notify
          data:
            message: "Probe 1 has reached the target temp. Currently {{ states.sensor.probe_1.state }} F"

    - alias: "Probe 2 Target Temp"
      trigger:
        - platform: state
          entity_id: sensor.target_alert_temp_probe_2
          to: 'Alert'
      action:
        - service: notify.ios_notify
          data:
            message: "Probe 2 has reached the target temp. Currently {{ states.sensor.probe_2.state }} F"

    - alias: "Probe 3 Target Temp"
      trigger:
        - platform: state
          entity_id: sensor.target_alert_temp_probe_3
          to: 'Alert'
      action:
        - service: notify.ios_notify
          data:
            message: "Probe 3 has reached the target temp. Currently {{ states.sensor.probe_3.state }} F"

ui-lovelace.yaml

    - icon: mdi:pig
        title: iGrill
        cards:
          - type: vertical-stack
            cards:
             - type: weather-forecast
               entity: weather.openweathermap
             - type: entities
               show_header_toggle: true
               title: Weber iGrill
               entities:
                 - entity: sensor.probe_1
                   secondary_info: last-changed
                 - entity: sensor.probe_2
                   secondary_info: last-changed
                 - entity: sensor.probe_3
                   secondary_info: last-changed
                 - entity: sensor.probe_4
                   secondary_info: last-changed
                 - entity: sensor.igrill_battery
                   secondary_info: last-changed
          - type: horizontal-stack
            cards:
             - type: custom:gauge-card
               title: Probe 1
               entity: sensor.probe_1
               min: 0
               max: 350
               severity:
                 red: 190
                 green: 65
                 amber: 0
             - type: custom:gauge-card
               title: Probe 2
               entity: sensor.probe_2
               min: 0
               max: 350
               severity:
                 red: 190
                 green: 65
                 amber: 0
          - type: horizontal-stack
            cards:
             - type: custom:gauge-card
               title: Probe 3
               entity: sensor.probe_3
               min: 0
               max: 350
               severity:
                 red: 190
                 green: 65
                 amber: 0
             - type: custom:gauge-card
               title: Probe 4 (Ambient)
               entity: sensor.probe_4
               min: 0
               max: 425
               severity:
                 red: 300
                 green: 90
                 amber: 0
    - type: history-graph
            title: 'History'
            entities:
              - sensor.probe_1
              - sensor.probe_2
              - sensor.probe_3
              - sensor.probe_4
          - type: entities
            title: iGrill info
            entities:
              - input_number.grill_alert_low
              - input_number.grill_alert_high
              - sensor.grill_alert_temp
              - input_number.grill_probe_1_target
              - sensor.target_alert_temp_probe_1
              - input_number.grill_probe_2_target
              - sensor.target_alert_temp_probe_2
              - input_number.grill_probe_3_target
              - sensor.target_alert_temp_probe_3
              - automation.monitor_grill_temp_alert
              - automation.monitor_grill_temp_normal
              - automation.probe_1_target_temp
              - automation.probe_2_target_temp
              - automation.probe_3_target_temp
1 Like

This is really nice. I have a plugin for the FireBoard with HomeSeer but no graphic dashboard like this. I wonder if I can integrate HomeSeer and Home Assistant for a dashboard use case? Thoughts are flowing :slight_smile:

1 Like

Anybody any luck with getting the integration to work?

After changing a few hard-coded items (e.g. the MAC address of the iGrill 2 device) I still can’t get it to run - this is the current error message:

2018-08-06 19:34:58,650 MainThread INFO: log_level set to: INFO
Traceback (most recent call last):
  File "./monitor.py", line 51, in <module>
    main()
  File "./monitor.py", line 27, in main
    client = mqtt_init(config['mqtt'])
  File "/home/pi/igrill/utils.py", line 50, in mqtt_init
    mqtt_client.connect(**strip_config(mqtt_config, ['host', 'port', 'keepalive']))
  File "/home/pi/igrill/utils.py", line 100, in strip_config
    return {k: v for k, v in config.iteritems() if k in allowed_keys and v}
AttributeError: 'dict' object has no attribute 'iteritems'

i got it working over the weekend but it wasn’t as straight forward as i had hoped.

are you running monitor.py or monitor_igrill_v2.py?
i couldn’t get the monitor.py to work, so i reverted to monitor_igrill_v2.py and just updated the script manually

Hmmmm…I have it working with monitor.py, did you pull the enable_threading branch. I tried several different forks from that repo and the one I linked seem to work the best.

Is the mqtt.yaml config correct syntax ? Did you put the location of your broker in there?

Ya I kept getting weird errors but it is probably something dumb I did on my end.

I’m inclined to leave it alone now though.

I am using the enable_threading branch, I changed:

  1. #!/usr/bin/env python in monitor.py to #!/usr/bin/env python3
  2. ADDRESS and mqtt_server in monitor_igrill_v2.py
  3. mqtt.yaml to show my host IP and port for my mqtt server

3 shouldn’t have been nexessary, I think, because the mqtt info is hardcoded in the file monitor_igrill_v2.py anyway

But the error messages above are still what I get :frowning:

I think is uses the hard coded values if it doesn’t find a config file.

I ran into issues trying to run in with python 3. One other person I exchanged messages said he had issues running it with Jessie, so he updated to stretch

Thanks for the hint - I have another Pi3 running on stretch, I will try it on that one.

Now that I think of it, that error you are having is the last error I got when trying to run it with python 3. I fixed a couple along the way, but then got this one, and said forget it, I will run it with python 2:

First time poster, fairly new HA user. When I run haas --script check config on both the configuration.yaml and ui-lovelace yaml, I am getting the error Component not found: igrill. Any idea what I am missing?

There really is no component called igrill, can you included the relevant portions of your config.yaml and ui-lovelace and I will take a look.

I do have a group setup, but that shouldn’t impact unless you reference it somewhere, I don’t think I reference it, but just in case here is what I have, in my groups.yaml:

igrill:
    name: Weber iGrill
    entities:
      - sensor.probe_1
      - sensor.probe_2
      - sensor.probe_3
      - sensor.probe_4
      - sensor.igrill_battery
      - input_number.grill_probe_1_target
      - sensor.target_alert_temp_probe_1
      - input_number.grill_probe_2_target
      - sensor.target_alert_temp_probe_2
      - input_number.grill_probe_3_target
      - sensor.target_alert_temp_probe_3
      - input_number.grill_alert_low
      - input_number.grill_alert_high
      - sensor.grill_alert_temp
      - automation.monitor_grill_temp_alert
      - automation.monitor_grill_temp_normal 
      - automation.probe_1_target_temp
      - automation.probe_2_target_temp
      - automation.probe_3_target_temp

Well, I’m not sure what it was. I added the Group and was getting the same issue. I then redid the complete configuration.yaml and while it appears to be identical, something must have been “off”. It works with and without the Group, so I’m not sure what was going on. (copied out to Notebook ++ and then pasted back) :man_shrugging:

For the record, I’ll be modifying this for my Ivation sensor (433 mHz) and my existing python script using rtl_433 that sends MQTT info.

Cool!!! Glad you got past that error.