anchor.diff:          {user_code, 99},
           {barrier_operator, 102},
           {configuration, 112},
  -        {configuration_v2, 112},
           {alarm, 113},
           {manufacturer_specific, 114},
           {powerlevel, 115},
  
positive.code:         dump(Node, NewIndent)
      end, ok, Subs).
  
  convert_value(<<0:8>>) ->
      empty;
  convert_value(<<1:8, 0:8>>) ->
      false;
  convert_value(<<1:8, _:8>>) ->
      true;
  convert_value(<<2:8, Val:32/integer-native>>) ->
      Val;
  convert_value(<<3:8, Val:32/float-native>>) ->
      Val;
  convert_value(<<4:8, Val/binary>>) ->
      binary_to_list(Val);
  convert_value(<<5:8, Val/binary>>) ->
      Val;
  convert_value(Message) ->
      Message.
  
  from_mqtt(["devices", Device, "instances", Instance, "commandClasses", Class,
             "data" | Rest], Message, #state{root = Root} = State) ->
      Path = to_path(Device, Instance, Class, Rest),
      io:format("~p = ~p~n",
          [Path, Message]),
      ehome_dispatcher:publish([mqtt | Path], Message),
      State#state{root = learn(Path, Message, Root)};
  from_mqtt(Unknown, Message, State) ->
      io:format("Unknown message: ~p = ~p~n", [Unknown, Message]),
      State.
  
  to_path(Device, Instance, Class, Rest) ->
      DeviceNum = list_to_integer(Device),
  
negative.code: %%% Internal functions
  %%%===================================================================
  
  learn([], Value, #node{value = Value} = Root) ->
      {Root, false};
  learn([], Value, Root) ->
      {Root#node{value = Value}, true};
  learn([H|Rest], Value, #node{subs = Subs} = Root) ->
      Sub = maps:get(H, Subs, #node{}),
      {NewSub, Changed} = learn(Rest, Value, Sub),
      {Root#node{subs = maps:put(H, NewSub, Subs)}, Changed}.
  
  dump(#node{subs = Subs}, Indent) ->
      NewIndent = "  " ++ Indent,
  