Skip to content

Migration Guide for HAA V12 Merlin

José Antonio Jiménez Campos edited this page Apr 21, 2023 · 36 revisions

HAA V12 Merlin has some breaking changes from v12 Peregrine. These changes are mainly about GPIO definitions, meaning that scripts must be adapted to be compatible with new version.

GPIO Configuration

Before, GPIOs configurations were taken directly from different parts of the script. Configurations about INPUT, OUTPUT, OPENDRAIN, PULL-UP, PWM, initial state, etc. Now, there is an unique section to do this, avoiding duplicity and confusions.

Since v12, GPIO declarations must be in an array "io":[...] into configuration "c":{...} section.

See GPIOs Configuration details.

Binary Outputs

Declarations of type "r":[{...}] into actions, that set a GPIO LOW or HIGH, to activate a relay, or a LED, for example, uses GPIO that must be declared into "io":[...] as Output.

Example 1:

"r":[{"g":12}] will need the following declaration into "io":

"io":[
  [ [ 12 ], 0, 2 ]
]

Example 2:

"r":[{"g":12},{"g":13,"v":1}] will need the following declaration into "io". Note that GPIOs 12 and 13 has same configuration:

"io":[
  [ [ 12, 13 ], 0, 2 ]
]

Example 3:

"r":[{"g":5,"n":1}] and other action with "r":[{"g":4,"v":1}] will need the following declaration into "io".

"n":1 used to set GPIO 5 to HIGH must be removed, because initial state now is declared in "io":

"io":[
  [ [ 5 ], 0, 2, 1 ],
  [ [ 4 ], 0, 2 ]
]

Buttons/Switches

TO-DO

PWM

TO-DO

NRZ

TO-DO

Binary Inputs

Some Services use special drivers with GPIO, and now they need to declare them into "io":[...] array.

Power Measure Service with HLW8012/BL0937

"dt" : [ CF, CF1, Sel ]: Power Measure service with "n":1 or "n":2 needs to declare used CF and CF1 GPIOs as Input into "io":[...] array, and Sel GPIO as Output. See GPIOs Configuration

For example:

"dt" : [ 12, 13, 15 ] will need:

"io":[
  [ [ 12, 13 ], 0, 1 ],
  [ [ 15 ], 0, 2 ]
]

Free Monitor Service with Pulse

GPIOs from "g" : [ GPIO, Type, Pull-up, Trigger GPIO ] must be declared into "io":array.

Because Pull-up is declared into "io" array, it must be removed from "g":[...] array from Free Monitor, because in v12, declaration is "g" : [ GPIO, Type, Trigger GPIO ].

GPIO must be Input. If Pull-up is missing or 0, remove it from following declaration: [ [ GPIO ], 1, Pull-up ]

Trigger GPIO must be Output: [ [ Trigger GPIO ], 2 ]

For example:

"g" : [ 12, 1, 1, 16 ] will be "g" : [ 12, 1, 16 ], and needs:

"io":[
  [ [ 12 ], 1, 1],
  [ [ 16 ], 2 ]
]

UART

TO-DO

Clone this wiki locally