Red Sea LED Aquarium Lights

That’s the rest.yaml indeed!
Yes sure, below the yaml from my representation in HA. This is part of a dashboard view which uses sections.

path: myTank
subview: false
type: sections
max_columns: 2
icon: mdi:fish
cards: []
sections:
  - type: grid
    cards:
      - type: heading
        heading: RSDOSE
        heading_style: title
        badges:
          - type: entity
            show_state: true
            show_icon: true
            entity: sensor.rsdose_heads
            icon: mdi:heat-pump-outline
            name: RSDOSE
            color: state
      - type: custom:mushroom-template-card
        primary: 1 - {{ state_attr('sensor.rsdose_head1','supplement') }}
        secondary: >-
          {{ state_attr('sensor.rsdose_head1','auto_dosed_today') }}ml / {{
          state_attr('sensor.rsdose_head1','daily_dose') }}ml
        icon: mdi:heat-pump
        entity: sensor.rsdose_head1
        layout_options:
          grid_columns: 2
          grid_rows: 2
        icon_color: >-
          {% if is_state('sensor.rsdose_head1','on') %} green {% else %} red {%
          endif %}
      - type: custom:mushroom-template-card
        primary: 2 - {{ state_attr('sensor.rsdose_head2','supplement') }}
        secondary: >-
          {{ state_attr('sensor.rsdose_head2','auto_dosed_today') }}ml / {{
          state_attr('sensor.rsdose_head2','daily_dose') }}ml
        icon: mdi:heat-pump
        entity: sensor.rsdose_head2
        layout_options:
          grid_columns: 2
          grid_rows: 2
        icon_color: >-
          {% if is_state('sensor.rsdose_head2','on') %} green {% else %} red {%
          endif %}
      - type: custom:mushroom-template-card
        primary: 3 - {{ state_attr('sensor.rsdose_head3','supplement') }}
        secondary: >-
          {{ state_attr('sensor.rsdose_head3','auto_dosed_today') }}ml / {{
          state_attr('sensor.rsdose_head3','daily_dose') }}ml
        icon: mdi:heat-pump
        entity: sensor.rsdose_head3
        layout_options:
          grid_columns: 2
          grid_rows: 2
        icon_color: >-
          {% if is_state('sensor.rsdose_head3','on') %} green {% else %} red {%
          endif %}
      - type: custom:mushroom-template-card
        primary: 4 - {{ state_attr('sensor.rsdose_head4','supplement') }}
        secondary: >-
          {{ state_attr('sensor.rsdose_head4','auto_dosed_today') }}ml / {{
          state_attr('sensor.rsdose_head4','daily_dose') }}ml
        icon: mdi:heat-pump
        entity: sensor.rsdose_head4
        layout_options:
          grid_columns: 2
          grid_rows: 2
        icon_color: >-
          {% if is_state('sensor.rsdose_head4','on') %} green {% else %} red {%
          endif %}
    column_span: 2

Looks like my config is not using
sensor: !include rest.yaml

Looks like my config is not using
sensor: !include rest.yaml

When you’re using a separate config file for your REST config, you need to add this to your configuration.yaml (assuming you save your REST config in a file named rest.yaml):

rest: !include rest.yaml

1 Like

DAMN :crazy_face:
Thank you my friend

Sorry, I forgot about the include. I thought you had it. Glad it all worked out!

Thank you.I just copy past and never noticed it was wrong :expressionless:

If I ever manage to add to the app the Maxspect blues i am so curious that something similar to the Red Sea lights can be achieved

I configured a mitmproxy/mitmdump on a docker container and pointed my iphone at it. My docker-compose file:

services:
  mitmweb:
    image: mitmproxy/mitmproxy
    tty: true
    ports:
      - 8080:8080
      - 8081:8081
    command: mitmweb --web-host 0.0.0.0
    restart: always

  mitmdump:
    image: mitmproxy/mitmproxy
    command: mitmdump -nC /home/mitmproxy/flows
    volumes:
      - ./mitmproxy:/home/mitmproxy/
    restart: always

Once the proxy is up and running (I followed these directions at Setting up mitmproxy on iOS | Sayan’s Blog):

  • Settings > WiFi and then tap on the (i) icon beside the network your are connected to.

  • Scroll down to the bottom and tap on “Configure Proxy”.

  • Select Manual, put the proxy server IP and port (“yourproxyhost:8080”), and save.

  • Open Safari on the iOS device and open mitm.it. Choose the CA certificates for your phone and follow the directions.

  • In settings, a “downloaded profiles” option appears at the root level. Click into the option and install the profile.

  • Go to Settings > General > About and scroll down to the bottom of the page. You will see a menu item titled “Certificate Trust Settings”. Tap on it and enable the certificate for “mitmproxy” in the following page.

  • Open the proxy service site at http://yourproxyhost:8081, you’ll see the UI.

  • Open the Red Sea app, and proceed into the app to the Manual settings…


For my RSLED 90 lights, I observed the following command endpoints through proxy using the manual setting in the app (when you send the given payload in the POST body):

MANUAL - this sets the lights to the requested color. The lights stay that color until the mode call is issued. It returns the same structure with two additional values: fan and temperature - but does not seem to respond to trying to set either of them (i.e. you can’t turn the fan on and off). The light color parameters are a value between 0 and 100.

manual : {
    "blue": 100,
    "moon": 0,
    "white": 100
}

MODE - this restores the light to the automatic mode configured in the app. I did not try to chase down all of the ways to set a program, but there are endpoints for getting and setting them if you want to do that. It returns the current mode (auto, timer, or manual - in my limited testing).

mode : {
    mode: auto
}

TIMER - this sets the light colors for the requested duration in minutes. It also returns a structure with the timer status and time remaining.

timer: {
    "blue": 100,
    "duration": 30,
    "moon": 0,
    "white": 100
}

I also saw two other endpoints, which might respond to commands:

moonphase
acclimation

For MY purposes, I really only want the MANUAL, MODE, and TIMER endpoints, and I will build an integration with those to include a color temperature/brightness setting, a photo mode service (using a timer?), and to mimic the moon phase (probably using something from HA to get the actual moon phase).

Also, I believe the lights show up in zeroconf, so I can automatically find them in an integration.

Example curl commands (replace xx.xx.xx.xx with the IP address of your light):

curl -i -X POST -H 'Content-Type: application/json' -d '{"white": 100, "blue":50, "moon": 0 }' http://xx.xx.xx.xx/manual
curl -i -X POST -H 'Content-Type: application/json' -d '{"mode": "auto" }' http://xx.xx.xx.xx/mode
curl -i -X POST -H 'Content-Type: application/json' -d '{"white": 100, "blue":50, "moon": 0, "duration": 1 }' http://xx.xx.xx.xx/timer
2 Likes

What did you use to decompile?I wanna give a try at synG app.
TIA

http://.../supplement
I try to get the volume from here but with no luck

Great work @bretton.wade, will try out this proxy methode as well. I’m also interested on your integration progress. If you need someone to test it, please let me know!

@raz77281, Do you mean something like this?

rest:
  - resource: http://***.***.***.***/supplement
    sensor:
      - name: "Head 1 - Container Volume"
        unique_id: "head1_container_volume"
        value_template: "{{ value_json[0]['container_volume'] }}"

      - name: "Head 2 - Container Volume"
        unique_id: "head2_container_volume"
        value_template: "{{ value_json[1]['container_volume'] }}"

I started an integration for the ReefLED lights. So far I have the boilerplate integration and a functional API - still working on these things and will give an update when it’s far enough along to make testing it worthwhile.

1 Like

Yes something like this but is not working.

Just fooling around.

1 Like

Btw.I have 2 4 head doser boards that seems to be in a boot loop.Any ideas what we could do with them?!

Hi all.

Thanks to all and particularly @g1n0 and @bretton.wade for the great work here.

I followed your lead and used MITM proxy to discover more endpoints and payloads.

A while ago I played with a Mobius to MQTT integration for Ecotech devices but I’ve slowly been migrating to RedSea devices and wanted to add these to HA.

Leveraging the work done by those in this thread, I’ve had a first go at integrating my RedSea devices.

I chose a slightly different route and sharing here in case it’s useful for others.

I’m using node-red and the ReefBeat cloud API to interact with devices. Devices can be controlled locally without the cloud API, but I used the cloud API to get aquarium info including:

  • Devices
  • IP addresses
  • Notifications
  • Aquarium info

Using this method means you don’t have to reserve IP addresses on your router and it dynamically creates sensors and controls for the devices you have.

The HA node-red integration exposes sensors and control entities. I used node-red as I’m familiar with it and it provides an easy way to manage oAuth and payloads for control.

I have tested RedSea pump, doser, roller mat, and wave maker. I don’t have lights or ATO but it looks like most of the useful endpoints for lights are on this thread.

HA can control:

  • Aquarium feed mode
  • ReefRun pump and skimmer intensity
  • ReefWave forward/reverse intensity/time and pulse time
  • ReefMat can be advanced
  • ReefDose daily dose can be updated. The neat thing about this is that HA automations can be used to adjust the amount of supplement from sensors. For example, my ReefBot alk, cal, mag, and PO4 readings are used to auto adjust daily dose. Manual tests and HA sensors could be used in the same way.

Here are some examples of the devices and entities exposed by the integration in HA:






And some example simple mushroom cards:



If you already use node-red it should just be as simple as importing the flow and adding your credentials and HA address. If you don’t have node-red, you’ll need to install it, and the HA integrations. Or you could choose use the native HA yaml REST stuff with the endpoints and payloads documented in my GitHub.

The flow and a quick document of the endpoints, payloads, and installation process are on this repository:

Cheers

3 Likes

Nice work thetastate!

I finally had some spare time to start working on an integration. It is pretty basic, but you could install it as a custom repository in HACS.
It support some basic sensors on the ReefATO and ReefMat. Will expand in the future.

Also, this works locally. So no cloud dependency :+1:

2 Likes

Hi,
here is my work for the ReefLed part.

Great work! Have you considered allowing a get/set color temperature option?