Looking for support for Mocreo Environmental Sensors

https://mocreo.com/doc/webapi/index.html

I was hoping someone who knew more than I could throw together an integration to pull data from these Wifi connected environment sensors. I’d hope it would be a simple thing but I just don’t know enough about it.

I know I’m late on this reply, but I’ve been meaning to get this working for a while. I finally got around to investigating the API and it does not support retrieving data from temperature sensors at this time. So, I had to go another route.

I ended up implemented a web scraper using HA Multiscrape. One benefit is this all runs locally, so there is no dependency on Internet access. My configuration (I have three sensors):

multiscrape:
  - resource: 'http://192.168.100.100/sensors'
    scan_interval: 300
    form_submit:
      resource: 'http://192.168.100.100/login'
      select: 'body > div > div > div > div > div.card-body > form'
      input:
        passwd: !secret mocreo_password
    sensor:
      - unique_id: mocreo_refrigerator_temp
        name: Refrigerator Temperature
        device_class: temperature
        unit_of_measurement: '°F'
        select: 'div > div:nth-child(1) > div.card-body > div > div:nth-child(1) > span.digits'
      - unique_id: mocreo_refrigerator_humid
        name: Refrigerator Humidity
        device_class: humidity
        unit_of_measurement: '%'
        select: 'div > div:nth-child(1) > div.card-body > div > div:nth-child(2) > span.digits'
      - unique_id: mocreo_freezer_temp
        name: Freezer Temperature
        device_class: temperature
        unit_of_measurement: '°F'
        select: 'div > div:nth-child(2) > div.card-body > div > div:nth-child(1) > span.digits'
      - unique_id: mocreo_freezer_humid
        name: Freezer Humidity
        device_class: humidity
        unit_of_measurement: '%'
        select: 'div > div:nth-child(2) > div.card-body > div > div:nth-child(2) > span.digits'
      - unique_id: mocreo_chest_freezer_temp
        name: Chest Freezer Temperature
        device_class: temperature
        unit_of_measurement: '°F'
        select: 'div > div:nth-child(3) > div.card-body > div > div:nth-child(1) > span.digits'
      - unique_id: mocreo_chest_freezer_humid
        name: Chest Freezer Humidity
        device_class: humidity
        unit_of_measurement: '%'
        select: 'div > div:nth-child(3) > div.card-body > div > div:nth-child(2) > span.digits'

Hopefully this will help.

3 Likes

I’m glad you took the time to reply even if delayed. I set this up for my Mocreo hub with 3 sensors yesterday. Everything was working as expected until just a few minutes ago. I have 2 sensors in 2 different freezers and 1 sensor in a refrigerator.

A few minutes ago, the HA sensor I named as the refrigerator was showing the temperature of one of the freezers and one of the freezers was showing the fridge temp. I had a brief moment of panic when I saw the freezer was above freezing until I realized what had happened.

I am admittedly asking before looking into it further, but is there a way to set up the sensors in HA so that they do not switch? I am planning to set up notifications when a temperature gets out of range.

Yes, I eventually ended up having the same problem. A recent firmware update to the Mocreo hub causes sensors to start randomly changing order on a regular basis. This has pretty much made the HA Multscrape method useless.

Since then, I have started using sensors to directly connect via ZHA bypassing the HUB, but two sensors have already died. I am now looking for an alternative.

Thanks for the info. I too am looking for an alternative.

I added a webpage to lovelace, had to edit it on each pc computer and phone with user name and password, logged in and saved. comes up right a way

@KitP Looks like the API now supports retrieving data from the sensors.

Hi relatively new here. Does anybody already have an API wrapper for Mocreo that they can share? Is there some generic REST polling that HA can do similar to the Multiscrape suggestion which seems OBE at this point?

Hi,
I’m trying to scrape my Mocreo hub webpage with a slight different aproach.
My train of thought is, if I also scrape the serial number together with the temperature, I can do some kind of post-processing parsing, maybe an extra separate template sensor on top of it. So the card moving position in the hub wouldn’t be an issue.

So far I got this far, being able to scrape the whole card into each multiscrape sensor, and splitting the individual values into attributes:

multiscrape:
  - resource: 'https://mocreo_hub.mydomain.com/sensors'  #behind reverse proxy
    log_response: true
    scan_interval: 300
    verify_ssl: false
    form_submit:
      resource: 'https://mocreo_hub.mydomain.com/login'
      select: 'body > div > div > div > div > div.card-body > form'
      input:
        passwd: !secret mocreo_password
    sensor:
      - unique_id: multiscrape_sensor1
        name: MultiscrapeSensor1
        # device_class: temperature
        # unit_of_measurement: '°F'
        select_list: 'div > div:nth-child(1) > div > div > div'
        value_template: '{{ value.split(",") }}'
        attributes:
          - name: Model
            select_list: 'div > div:nth-child(1) > div > div > div'
            value_template: '{{ value.split(",")[0] | trim }}'
          - name: SerialNumber
            select_list: 'div > div:nth-child(1) > div > div > div'
            value_template: '{{ value.split(",")[1].split(":")[1] | trim }}'
          - name: Temperature
            select_list: 'div > div:nth-child(1) > div > div > div'
            value_template: '{{ value.split(",")[2] | trim("°F") }}'
      - unique_id: multiscrape_sensor2
        name: MultiscrapeSensor2
        # device_class: temperature
        # unit_of_measurement: '°F'
        select_list: 'div > div:nth-child(2) > div > div > div'
        value_template: '{{ value.split(",") }}'
        attributes:
          - name: Model
            select_list: 'div > div:nth-child(2) > div > div > div'
            value_template: '{{ value.split(",")[0] | trim }}'
          - name: SerialNumber
            select_list: 'div > div:nth-child(2) > div > div > div'
            value_template: '{{ value.split(",")[1].split(":")[1] | trim }}'
          - name: Temperature
            select_list: 'div > div:nth-child(2) > div > div > div'
            value_template: '{{ value.split(",")[2] | trim("°F ") }}'

To be honest I’m not really sure yet what to do next. I’m sharing here to see if anyone also trying to scrape those sensors pick it from here and come up with an evolution of all this.

One step further now,
the state of each sensor is a json string now, so everything can be glued together for further processing.

It’s not final, but I feel this approach is getting very robust.

Scraping is all done at this point. Now we only need to parse a JSON string using template sensors, which should be easier than dealing with css selectors, but my brain is exhausted, I’ll call it a day.
Any help creating the template sensors for the final step is apreciated. :upside_down_face:

multiscrape:
  - resource: 'https://mocreo_hub.mydomain.com/sensors'  #behind reverse proxy
    log_response: true
    scan_interval: 300
    verify_ssl: false
    form_submit:
      resource: 'https://mocreo_hub.mydomain.com/login'
      select: 'body > div > div > div > div > div.card-body > form'
      input:
        passwd: !secret mocreo_password
    sensor:
      - unique_id: multiscrape_sensor1
        name: MultiscrapeSensor1
        select_list: 'div > div:nth-child(1) > div > div > div'
        value_template: >-
          {"serialnumber":"{{ value.split(',')[1].split(':')[1] | trim }}",
          "model":"{{ value.split(',')[0] | trim }}",
          "temperature":"{{ value.split(',')[2].split('°')[0] | trim }}",
          "unit_of_measurement":"°{{ value.split(',')[2].split('°')[1] | trim}}"}
      - unique_id: multiscrape_sensor2
        name: MultiscrapeSensor2
        select_list: 'div > div:nth-child(2) > div > div > div'
        value_template: >-
          {"serialnumber":"{{ value.split(',')[1].split(':')[1] | trim }}",
          "model":"{{ value.split(',')[0] | trim }}",
          "temperature":"{{ value.split(',')[2].split('°')[0] | trim }}",
          "unit_of_measurement":"°{{ value.split(',')[2].split('°')[1] | trim}}"}

And then a template sensor which glues everything back together into a list of dictionaries.

{{ [states('sensor.multiscrapesensor1')|from_json,states('sensor.multiscrapesensor2')|from_json] }}

[{‘serialnumber’: ‘00123’, ‘model’: ‘ST5’, ‘temperature’: ‘10.4’, ‘unit_of_measurement’: ‘°F’}, {‘serialnumber’: ‘00345’, ‘model’: ‘ST5’, ‘temperature’: ‘36.5’, ‘unit_of_measurement’: ‘°F’}]

Ok, I’m back with a full and complete solution. and without the need of extra template sensors. everything self-contained inside multiscrape sensors.

The instructions are: replace the serial number values, and that is it. It will work even it the sensors change order in the hub webpage.

Here it is the config:


multiscrape:
  - resource: 'https://mocreo_hub.mydomain.com/sensors' #behind reverse proxy
    scan_interval: 300
    verify_ssl: false
    form_submit:
      resource: 'https://mocreo_hub.mydomain.com/login'
      select: 'body > div > div > div > div > div.card-body > form'
      input:
        passwd: !secret mocreo_password
    sensor:
      - unique_id: mocreo_0000AEIEAEAEEA300
        name: Mocreo 0000AEIEAEAEEA300
        device_class: temperature
        state_class: measurement
        unit_of_measurement: '°F'
        select_list: 'div:has(>.card-header):contains("0000AEIEAEAEEA300")>div>div>div'
        value_template: '{{ value.split(",")[2].split("°")[0] | trim | float }}'
        attributes:
          - name: json
            select_list: 'div:has(>.card-header):contains("0000AEIEAEAEEA300")>div>div>div'
            value_template: >-
              {"serialnumber":"{{ value.split(',')[1].split(':')[1] | trim }}",
              "model":"{{ value.split(',')[0] | trim }}",
              "temperature":"{{ value.split(',')[2].split('°')[0] | trim }}",
              "unit_of_measurement":"°{{ value.split(',')[2].split('°')[1] | trim}}"}
          - name: model
            select_list: 'div:has(>.card-header):contains("0000AEIEAEAEEA300")>div>div>div'
            value_template: '{{ value.split(",")[0] | trim }}'
          - name: serialnumber
            select_list: 'div:has(>.card-header):contains("0000AEIEAEAEEA300")>div>div>div'
            value_template: '{{ value.split(",")[1].split(":")[1] | trim }}'
          - name: temperature
            select_list: 'div:has(>.card-header):contains("0000AEIEAEAEEA300")>div>div>div'
            value_template: '{{ value.split(",")[2].split("°")[0] | trim }}'
          - name: unit_of_measurement
            select_list: 'div:has(>.card-header):contains("0000AEIEAEAEEA300")>div>div>div'
            value_template: '°{{ value.split(",")[2].split("°")[1] | trim}}'
      

@fialdrexs I installed the HACS Multiscape, used your complete solution, changing the serial#, password and the URL for my hub. It works awesome! But I can’t figure out how to add a second sensor. Any ideas how to add a second sensor using this config?

@brente , Good to hear that what I came up with was helpful to someone else.
For multiple sensors, same thing, just copy and paste the inner block of code and change the unique_id and serial number for your respective sensor.
I currently have 3 sensors and they are working great. All of them are model ST5. So all cards look the same and have the same structure to be scrapped. I’m not sure about different sensor models though.

The yaml configuration for multiple sensors will look more or less like:


multiscrape:
  - resource: 'https://mocreo_hub.mydomain.com/sensors' #behind reverse proxy
    scan_interval: 300
    verify_ssl: false
    form_submit:
      resource: 'https://mocreo_hub.mydomain.com/login'
      select: 'body > div > div > div > div > div.card-body > form'
      input:
        passwd: !secret mocreo_password
    sensor:
      - unique_id: mocreo_0000AEIEAEAEEA300
        name: Mocreo 0000AEIEAEAEEA300
        device_class: temperature
        etc etc etc....
        ............
      - unique_id: mocreo_000eaeaea_sensor_number2
        name: sensor_number2
        etc etc etc...
      - unique_id: mocreo_000333eaeea_sensor_number3
        etc etc etc etc....

This is great, I was able to set it up to scrape several ST5 probes I’ve installed at my house.

However it seems that every few days one of the hubs will go offline for 6+ hours and no data is scraped. When that happens its still sending data to the Mocreo cloud portal, but login to the local hub UI fails. A few hours later it seems to recover, or if I power-cycle the hub it recovers. I’m wondering if this is a problem with the local web UI being fetched too frequently, and each attempt starting with a login, generating too many login sessions on the hub and eventually causing problems. I did set scan_interval in my config to 60, so I get data more often, but that may have been too agressive for the local hubs to handle.

Thank you all for all your hard work on this one. I have a question, has anyone figured out how to get the battery & signal level from the sensors? Thank you in advance.

I did!

Follow updated example for 3 separate ST5 sensors:

You only need to replace the placeholders for your actual sensor serial numbers, and of course the address/ip to your hub

multiscrape:
  - resource: 'https://mocreo_hub.reverse_proxy.com/sensors'
    scan_interval: 300
    verify_ssl: false
    form_submit:
      resource: 'https://mocreo_hub.reverse_proxy.com/login'
      select: 'body > div > div > div > div > div.card-body > form'
      input:
        passwd: !secret mocreo_password
    sensor:
      - unique_id: mocreo_sensor_1_serial
        name: Mocreo sensor_1_serial
        device_class: temperature
        state_class: measurement
        unit_of_measurement: '°F'
        select_list: 'div:has(>.card-header):-soup-contains("sensor_1_serial")>div>div>div'
        value_template: '{{ value.split(",")[2].split("°")[0] | trim | float }}'
        attributes:
          - name: model
            select_list: 'div:has(>.card-header):-soup-contains("sensor_1_serial")>div>div>div'
            value_template: '{{ value.split(",")[0] | trim }}'
          - name: serialnumber
            select_list: 'div:has(>.card-header):-soup-contains("sensor_1_serial")>div>div>div'
            value_template: '{{ value.split(",")[1].split(":")[1] | trim }}'
          - name: temperature
            select_list: 'div:has(>.card-header):-soup-contains("sensor_1_serial")>div>div>div'
            value_template: '{{ value.split(",")[2].split("°")[0] | trim }}'
          - name: unit_of_measurement
            select_list: 'div:has(>.card-header):-soup-contains("sensor_1_serial")>div>div>div'
            value_template: '°{{ value.split(",")[2].split("°")[1] | trim}}'
      
      - unique_id: mocreo_sensor_2_serial
        name: Mocreo sensor_2_serial
        device_class: temperature
        state_class: measurement
        unit_of_measurement: '°F'
        select_list: 'div:has(>.card-header):-soup-contains("sensor_2_serial")>div>div>div'
        value_template: '{{ value.split(",")[2].split("°")[0] | trim | float }}'
        attributes:
          - name: model
            select_list: 'div:has(>.card-header):-soup-contains("sensor_2_serial")>div>div>div'
            value_template: '{{ value.split(",")[0] | trim }}'
          - name: serialnumber
            select_list: 'div:has(>.card-header):-soup-contains("sensor_2_serial")>div>div>div'
            value_template: '{{ value.split(",")[1].split(":")[1] | trim }}'
          - name: temperature
            select_list: 'div:has(>.card-header):-soup-contains("sensor_2_serial")>div>div>div'
            value_template: '{{ value.split(",")[2].split("°")[0] | trim }}'
          - name: unit_of_measurement
            select_list: 'div:has(>.card-header):-soup-contains("sensor_2_serial")>div>div>div'
            value_template: '°{{ value.split(",")[2].split("°")[1] | trim}}'

      - unique_id: mocreo_sensor_3_serial
        name: Mocreo sensor_3_serial
        device_class: temperature
        state_class: measurement
        unit_of_measurement: '°F'
        select_list: 'div:has(>.card-header):-soup-contains("sensor_3_serial")>div>div>div'
        value_template: '{{ value.split(",")[2].split("°")[0] | trim | float }}'
        attributes:
          - name: model
            select_list: 'div:has(>.card-header):-soup-contains("sensor_3_serial")>div>div>div'
            value_template: '{{ value.split(",")[0] | trim }}'
          - name: serialnumber
            select_list: 'div:has(>.card-header):-soup-contains("sensor_3_serial")>div>div>div'
            value_template: '{{ value.split(",")[1].split(":")[1] | trim }}'
          - name: temperature
            select_list: 'div:has(>.card-header):-soup-contains("sensor_3_serial")>div>div>div'
            value_template: '{{ value.split(",")[2].split("°")[0] | trim }}'
          - name: unit_of_measurement
            select_list: 'div:has(>.card-header):-soup-contains("sensor_3_serial")>div>div>div'
            value_template: '°{{ value.split(",")[2].split("°")[1] | trim}}'


  - resource: 'https://mocreo_hub.reverse_proxy.com/nodes'
    scan_interval: 1000
    verify_ssl: false
    form_submit:
      resource: 'https://mocreo_hub.reverse_proxy.com/login'
      select: 'body > div > div > div > div > div.card-body > form'
      input:
        passwd: !secret mocreo_password
    sensor:
      - unique_id: mocreo_sensor_1_serial_diagnostic
        name: Mocreo sensor_1_serial diagnostic
        select_list: 'tr:-soup-contains("sensor_1_serial")>td>span.text-success'
        value_template: '{{ iif("" in value,"Online","Offline") }}'
        attributes:
          - name: type
            select_list: 'tr:-soup-contains("sensor_1_serial")>td'
            value_template: '{{ value.split(",")[0] | trim }}'
          - name: serialnumber
            select_list: 'tr:-soup-contains("sensor_1_serial")>td'
            value_template: '{{ value.split(",")[1] | trim }}'
          - name: battery
            select_list: 'tr:-soup-contains("sensor_1_serial")>td'
            value_template: '{{ value.split(",")[3] | trim }}'
          - name: signal
            select_list: 'tr:-soup-contains("sensor_1_serial")>td'
            value_template: '{{ value.split(",")[4] | trim }}'
          - name: online
            select_list: 'tr:-soup-contains("sensor_1_serial")>td>span.text-success'
            value_template: '{{ iif("" in value,"Online","Offline") }}'
          - name: last_seen
            select_list: 'tr:-soup-contains("sensor_1_serial")>td'
            value_template: '{{ value.split(",")[6] | trim }}'
          - name: version
            select_list: 'tr:-soup-contains("sensor_1_serial")>td'
            value_template: '{{ value.split(",")[7] | trim }}'
          - name: model
            select_list: 'tr:-soup-contains("sensor_1_serial")>td'
            value_template: '{{ value.split(",")[8] | trim }}'
      - unique_id: mocreo_sensor_1_serial_battery
        name: Mocreo sensor_1_serial battery
        device_class: battery
        state_class: measurement
        unit_of_measurement: '%'
        select_list: 'tr:-soup-contains("sensor_1_serial")>td'
        value_template: '{{ value.split(",")[3].split("%")[0] | trim | float }}'
        attributes:
          - name: type
            select_list: 'tr:-soup-contains("sensor_1_serial")>td'
            value_template: '{{ value.split(",")[0] | trim }}'
          - name: serialnumber
            select_list: 'tr:-soup-contains("sensor_1_serial")>td'
            value_template: '{{ value.split(",")[1] | trim }}'
          - name: battery
            select_list: 'tr:-soup-contains("sensor_1_serial")>td'
            value_template: '{{ value.split(",")[3] | trim }}'
          - name: signal
            select_list: 'tr:-soup-contains("sensor_1_serial")>td'
            value_template: '{{ value.split(",")[4] | trim }}'
          - name: online
            select_list: 'tr:-soup-contains("sensor_1_serial")>td>span.text-success'
            value_template: '{{ iif("" in value,"Online","Offline") }}'
          - name: last_seen
            select_list: 'tr:-soup-contains("sensor_1_serial")>td'
            value_template: '{{ value.split(",")[6] | trim }}'
          - name: version
            select_list: 'tr:-soup-contains("sensor_1_serial")>td'
            value_template: '{{ value.split(",")[7] | trim }}'
          - name: model
            select_list: 'tr:-soup-contains("sensor_1_serial")>td'
            value_template: '{{ value.split(",")[8] | trim }}'
       
       
      - unique_id: mocreo_sensor_2_serial_diagnostic
        name: Mocreo sensor_2_serial diagnostic
        select_list: 'tr:-soup-contains("sensor_2_serial")>td>span.text-success'
        value_template: '{{ iif("" in value,"Online","Offline") }}'
        attributes:
          - name: type
            select_list: 'tr:-soup-contains("sensor_2_serial")>td'
            value_template: '{{ value.split(",")[0] | trim }}'
          - name: serialnumber
            select_list: 'tr:-soup-contains("sensor_2_serial")>td'
            value_template: '{{ value.split(",")[1] | trim }}'
          - name: battery
            select_list: 'tr:-soup-contains("sensor_2_serial")>td'
            value_template: '{{ value.split(",")[3] | trim }}'
          - name: signal
            select_list: 'tr:-soup-contains("sensor_2_serial")>td'
            value_template: '{{ value.split(",")[4] | trim }}'
          - name: online
            select_list: 'tr:-soup-contains("sensor_2_serial")>td>span.text-success'
            value_template: '{{ iif("" in value,"Online","Offline") }}'
          - name: last_seen
            select_list: 'tr:-soup-contains("sensor_2_serial")>td'
            value_template: '{{ value.split(",")[6] | trim }}'
          - name: version
            select_list: 'tr:-soup-contains("sensor_2_serial")>td'
            value_template: '{{ value.split(",")[7] | trim }}'
          - name: model
            select_list: 'tr:-soup-contains("sensor_2_serial")>td'
            value_template: '{{ value.split(",")[8] | trim }}'
      - unique_id: mocreo_sensor_2_serial_battery
        name: Mocreo sensor_2_serial battery
        device_class: battery
        state_class: measurement
        unit_of_measurement: '%'
        select_list: 'tr:-soup-contains("sensor_2_serial")>td'
        value_template: '{{ value.split(",")[3].split("%")[0] | trim | float }}'
        attributes:
          - name: type
            select_list: 'tr:-soup-contains("sensor_2_serial")>td'
            value_template: '{{ value.split(",")[0] | trim }}'
          - name: serialnumber
            select_list: 'tr:-soup-contains("sensor_2_serial")>td'
            value_template: '{{ value.split(",")[1] | trim }}'
          - name: battery
            select_list: 'tr:-soup-contains("sensor_2_serial")>td'
            value_template: '{{ value.split(",")[3] | trim }}'
          - name: signal
            select_list: 'tr:-soup-contains("sensor_2_serial")>td'
            value_template: '{{ value.split(",")[4] | trim }}'
          - name: online
            select_list: 'tr:-soup-contains("sensor_2_serial")>td>span.text-success'
            value_template: '{{ iif("" in value,"Online","Offline") }}'
          - name: last_seen
            select_list: 'tr:-soup-contains("sensor_2_serial")>td'
            value_template: '{{ value.split(",")[6] | trim }}'
          - name: version
            select_list: 'tr:-soup-contains("sensor_2_serial")>td'
            value_template: '{{ value.split(",")[7] | trim }}'
          - name: model
            select_list: 'tr:-soup-contains("sensor_2_serial")>td'
            value_template: '{{ value.split(",")[8] | trim }}'
       
       
      - unique_id: mocreo_sensor_3_serial_diagnostic
        name: Mocreo sensor_3_serial diagnostic
        select_list: 'tr:-soup-contains("sensor_3_serial")>td>span.text-success'
        value_template: '{{ iif("" in value,"Online","Offline") }}'
        attributes:
          - name: type
            select_list: 'tr:-soup-contains("sensor_3_serial")>td'
            value_template: '{{ value.split(",")[0] | trim }}'
          - name: serialnumber
            select_list: 'tr:-soup-contains("sensor_3_serial")>td'
            value_template: '{{ value.split(",")[1] | trim }}'
          - name: battery
            select_list: 'tr:-soup-contains("sensor_3_serial")>td'
            value_template: '{{ value.split(",")[3] | trim }}'
          - name: signal
            select_list: 'tr:-soup-contains("sensor_3_serial")>td'
            value_template: '{{ value.split(",")[4] | trim }}'
          - name: online
            select_list: 'tr:-soup-contains("sensor_3_serial")>td>span.text-success'
            value_template: '{{ iif("" in value,"Online","Offline") }}'
          - name: last_seen
            select_list: 'tr:-soup-contains("sensor_3_serial")>td'
            value_template: '{{ value.split(",")[6] | trim }}'
          - name: version
            select_list: 'tr:-soup-contains("sensor_3_serial")>td'
            value_template: '{{ value.split(",")[7] | trim }}'
          - name: model
            select_list: 'tr:-soup-contains("sensor_3_serial")>td'
            value_template: '{{ value.split(",")[8] | trim }}'
      - unique_id: mocreo_sensor_3_serial_battery
        name: Mocreo sensor_3_serial battery
        device_class: battery
        state_class: measurement
        unit_of_measurement: '%'
        select_list: 'tr:-soup-contains("sensor_3_serial")>td'
        value_template: '{{ value.split(",")[3].split("%")[0] | trim | float }}'
        attributes:
          - name: type
            select_list: 'tr:-soup-contains("sensor_3_serial")>td'
            value_template: '{{ value.split(",")[0] | trim }}'
          - name: serialnumber
            select_list: 'tr:-soup-contains("sensor_3_serial")>td'
            value_template: '{{ value.split(",")[1] | trim }}'
          - name: battery
            select_list: 'tr:-soup-contains("sensor_3_serial")>td'
            value_template: '{{ value.split(",")[3] | trim }}'
          - name: signal
            select_list: 'tr:-soup-contains("sensor_3_serial")>td'
            value_template: '{{ value.split(",")[4] | trim }}'
          - name: online
            select_list: 'tr:-soup-contains("sensor_3_serial")>td>span.text-success'
            value_template: '{{ iif("" in value,"Online","Offline") }}'
          - name: last_seen
            select_list: 'tr:-soup-contains("sensor_3_serial")>td'
            value_template: '{{ value.split(",")[6] | trim }}'
          - name: version
            select_list: 'tr:-soup-contains("sensor_3_serial")>td'
            value_template: '{{ value.split(",")[7] | trim }}'
          - name: model
            select_list: 'tr:-soup-contains("sensor_3_serial")>td'
            value_template: '{{ value.split(",")[8] | trim }}'

Just got a new Mocreo hub and 2 Temp sensors…

Trying to set this up; It appears that the login works, but is going to some sort of a redirector page that says “Sign in OK”, pauses for a second, and then loads the main page. I suspect there is a cookie involved as well.

form_submit_response_headers.txt says: Headers({‘content-type’: ‘text/html; charset=UTF-8’, ‘set-cookie’: ‘id=b55ee920-6169-ca55-b78d-3119447ef3ba; Max-Age=86400;’})

And then when multiscrape goes to load the page to scrape it gets kicked back to the login… Anybody know how to make multiscrape work with the cookie?

I had the same problem… The issue has to do with a breaking change in MultiScrape
Update your configuration.yaml and add a verify_ssl: false in the form_submit section

it should look something like:
form_submit:
resource: ‘http://xxx.xxx.xxx.xxx/login
select: ‘body > div > div > div > div > div.card-body > form’
verify_ssl: false

More info at the bottom of issue 355 on the git hub page

1 Like

That totally fixed it. Thanks!!